Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I change the Xtick of the plot #148

Open
abugeralt opened this issue Jun 1, 2020 · 4 comments
Open

How can I change the Xtick of the plot #148

abugeralt opened this issue Jun 1, 2020 · 4 comments
Labels
enhancement New feature or request in progress question Further information is requested

Comments

@abugeralt
Copy link

image

As the picture shows, How can i change the Xtick to show the date by day.

@abugeralt abugeralt added the question Further information is requested label Jun 1, 2020
@DanielGoldfarb
Copy link
Collaborator

This is not directly available right now, but is definitely on the list of things to do. In the meantime you may try returnfig=True and see if there is a way to get creative and manipulate the xticks through the figure and axes list that are returned.

@char101
Copy link

char101 commented Jun 13, 2020

You'll need to customize the tick locator. For example:

from matplotlib.ticker import MultipleLocator

fig, axlist = mpl.plot(..., returnfig=True)
axlist[0].xaxis.set_minor_locator(MultipleLocator(1))

Note: this is untested code. I don't remember if it the bottom ticks is a major or minor ticks. You might need to change change minor to major. Also with small charts the text will surely overlap.

This is how it might look like

PTBA

@DanielGoldfarb DanielGoldfarb added enhancement New feature or request in progress labels Apr 5, 2021
@msampathkumar
Copy link

@char101: Hi, I tried your set_minor_locator suggestion in Google Colab with Version is 0.12.7a17. It did not work for me :(

One request: If I may ask, can you share the code for the image you shared ? (It looks super cool to me). Wizardry kind of 😄

@char101
Copy link

char101 commented Jun 26, 2021

@msampathkumar Sorry it has been too long and I don't have the code anymore. To do most of the customization, most of the time you only need two things: access to the axes variable and matplotlib documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request in progress question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants