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
If you print the get_text() function, all the texts appear to be fine. However, for unknown reasons, certain texts are not picked by the set_fontsize() method.
Expected outcome
All the "20YY" will be set to fontsize 10
Additional information
No response
Operating system
OS/X
Matplotlib Version
3.7.1
Matplotlib Backend
No response
Python version
3.10
Jupyter version
No response
Installation
None
The text was updated successfully, but these errors were encountered:
You set the tick fontsize, but then change the tick values because you set_xlim. If you put the set_xlim before the tick manipulation it works fine.
If you don't want this to be brittle, set the major locator to years, and the minor locator to months 4, 7, 10, and change the size of the minor tick labels...
for ax, x, y in zip(axs, xs, ys):
ax.plot(x, y)
locator = YearLocator()
ax.xaxis.set_major_locator(locator)
ax.xaxis.set_major_formatter(ConciseDateFormatter(locator))
locator = MonthLocator((4, 7, 10))
ax.xaxis.set_minor_locator(locator)
ax.xaxis.set_minor_formatter(ConciseDateFormatter(locator))
ax.tick_params(axis='x', labelsize=7, which='minor')
ax.set_xlim(date(2016, 7, 1))
I'm going to close this because there its relatively well understood that ticks need to be finalized before you reach into them and manually muck with them.
Bug summary
I'm trying to format ticklabels based on text on a time x axis.I have been experiencing inconsistent results with various formatters.
Code for reproduction
Actual outcome
If you print the
get_text()
function, all the texts appear to be fine. However, for unknown reasons, certain texts are not picked by theset_fontsize()
method.Expected outcome
All the "20YY" will be set to fontsize 10
Additional information
No response
Operating system
OS/X
Matplotlib Version
3.7.1
Matplotlib Backend
No response
Python version
3.10
Jupyter version
No response
Installation
None
The text was updated successfully, but these errors were encountered: