Bug: xticklabels overwrites xminorticks setting
syrte opened this issue · comments
Description
xticklabels overwrites xminorticks setting
Steps to reproduce
Expected behavior with minorticks
fig, ax = pplt.subplot()
ax.format(
xticks=[0, 0.5, 1], #xticklabels=['a', 'b', 'c'],
xminorticks=[0.1, 0.2],
)
But I got this if setting xticklabels
fig, ax = pplt.subplot()
ax.format(
xticks=[0, 0.5, 1], xticklabels=['a', 'b', 'c'],
xminorticks=[0.1, 0.2],
)
minorticks are gone...
Proplot version
Paste the results of import matplotlib; print(matplotlib.__version__); import proplot; print(proplot.version)
here.
3.4.3
0.9.5.post341
Temporary workaround:
Set minor ticks manually after calling ax.format,
ax.set_xticks(tick_list, minor=True)
This was due to a format()
convenience feature: By default, if you pass major ticks labels, minor ticks are disabled, since it's pretty rare that users need both and since proplot changes the default matplotlib style to include minor ticks. This makes the process of setting up manual tick labels take 1 step instead of 2.
However, this should clearly be disabled if a minorlocator
is passed in the same call. Fixed by a397f81.