Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Description
Bug report
Bug summary
Units (e.g. datetime) and scales (e.g. log) both come with their own default locators (various DateLocators, LogLocator) and formatters (various DateFormatters, LogFormatter), which are being set inAxis._update_axisinfo
andAxis.set_scale
, respectively.
If a locator or formatter hasalready been manually set on the axis, then setting units willnot override the user-set locator/formatter -- this is tracked using the slighly awkwardly namedisDefault_{maj,min}{loc,fmt}
. On the other hand, setting a scalewill override locator/formatters previously set.
Code for reproduction
frompylabimport*subplot(121)xticks([])xscale("log")subplot(122)xticks([])plot_date([1,2], [3,4])show()
Actual outcome
Expected outcome
Consistent behavior between the two cases.#18571 (comment) is one where scales also respecting user-set locators/formatters would be nice, but I can also see an argument for the opposite behavior for simplicity...
Matplotlib version
- Operating system: linux
- Matplotlib version: HEAD
- Matplotlib backend (
print(matplotlib.get_backend())
): any - Python version: 38
- Jupyter version (if applicable):
- Other libraries: