You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On, e.g., ch3-ex2 and ch4-ex1, a string formatter is used to 'format' years on the x-axis which would otherwise appear as decimals (2015.0 -> 2015, 2017.5 -> 2018). This, however, appears to distort the actual x-axis labels, showing '2018' when at the spot which ought to be labeled '2017.5'.
You can see this from the following 2 code snippets using chapter3-example2, cell 8 (note the difference in the 2017.5 and 2018 labels which point to the same location):
I think the correct code to avoid the '20XX.5' in years might be something like ax.set_xticks(np.arange(2000, 2020, 2))?
The text was updated successfully, but these errors were encountered:
dcronkite
changed the title
ticker.StrMethodFormatter("{x:0.0f}" appears to obscure rather than clean year valuesticker.StrMethodFormatter("{x:0.0f}") appears to obscure rather than clean year values
Oct 1, 2022
Ah. Great catch! Thanks for pointing this out. I definitely didn't catch this.
You're correct the np.arange() code your using is a good alternative. I'm going to also look through the Matplotlib docs and see if something here might be a good alternative that is more "date-aware" https://matplotlib.org/stable/api/dates_api.html
I'm going to keep this open until I figure out the best approach and how to update the course.
On, e.g., ch3-ex2 and ch4-ex1, a string formatter is used to 'format' years on the x-axis which would otherwise appear as decimals (2015.0 -> 2015, 2017.5 -> 2018). This, however, appears to distort the actual x-axis labels, showing '2018' when at the spot which ought to be labeled '2017.5'.
You can see this from the following 2 code snippets using chapter3-example2, cell 8 (note the difference in the 2017.5 and 2018 labels which point to the same location):
I think the correct code to avoid the '20XX.5' in years might be something like
ax.set_xticks(np.arange(2000, 2020, 2))
?The text was updated successfully, but these errors were encountered: