-
-
Notifications
You must be signed in to change notification settings - Fork 393
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
Improve layout of plots with DateTimeIndex #1360
Comments
P.S. to fix this I had to peek into the plots in a very clumsy way, which might be another argument for returning a
This also shows it's harder to fix after the fact, than have ArviZ do it right to begin with! |
This used to work ax = az.plot_trace(trace); but This problem could happen with long labels not necessarily |
Yeah, we should fix |
Hi! I am taking a look at this right now. Meanwhile, this should work:
|
Hi! Can i take this up ? |
I'm not sure if we should check datetime stuff. Or would it be ok to just call pandas datetime autoformat. We really should have an easy way to change the defaults if user wants it. |
#1361 will allow this to work again. ax = az.plot_trace(trace) I think this should be enough, as allow full control on the user side. Unless someone offers a general default solution (not only for dates). |
Hi @abhisht51! Are you searching for matplotlib related issues? Or more general plotting issues? ArviZ has both matplotlib and bokeh backends. If you prefer we can also talk in Gitter. |
Tell us about it
Plots with dates on their x axis can be typeset poorly. Here is an example from https://docs.pymc.io/notebooks/getting_started.html
The x coordinate here is a
DateTimeIndex
:Looking at the web, I see that there are techniques for better formatting such axes: https://www.delftstack.com/howto/matplotlib/how-to-rotate-x-axis-tick-label-text-in-matplotlib/#fig-autofmt-xdate-rotation-to-rotate-xticks-label-text
Revised using a rotation argument for the xticklabels:
Thoughts on implementation
We look at the label of the x axis, and if it is a
DateTimeIndex
, we automatically use one of these techniques.Note: this advice applies only to the matplotlib back-end -- I don't know enough about bokeh to know if there is a corresponding technique there.
The text was updated successfully, but these errors were encountered: