Skip to content
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

Inconsistency between AutoLocator and AutoDateLocator #9558

Closed
Mark531 opened this issue Oct 24, 2017 · 2 comments
Closed

Inconsistency between AutoLocator and AutoDateLocator #9558

Mark531 opened this issue Oct 24, 2017 · 2 comments
Assignees
Milestone

Comments

@Mark531
Copy link

Mark531 commented Oct 24, 2017

Bug report

Bug summary

The method tick_values() can be called directly with AutoLocator but not with AutoDateLocator.

Code for reproduction

from matplotlib.ticker import AutoLocator
l = AutoLocator()
l.tick_values(10, 20) # works

from matplotlib.dates import AutoDateLocator
import datetime

l = AutoDateLocator()
start = datetime.date(2002, 1, 5)
end = datetime.date(2003, 12, 1)
l.tick_values(start, end) # Error

Actual outcome

array([ 10.,  12.,  14.,  16.,  18.,  20.])
AttributeError: 'NoneType' object has no attribute 'get_view_interval'

Expected outcome

expect the AutoDateLocator to be independent of the axis or other graphical objects. It should be able to generate date ticks on its own.

Matplotlib version

  • Operating system: Win10
  • Matplotlib version: 1.5.1
  • Matplotlib backend (module://ipykernel.pylab.backend_inline):
  • Python version: 3.5.1
  • Jupyter version (if applicable):
  • Other libraries:

I'm using Anaconda (conda 4.2.9).

@dstansby
Copy link
Member

dstansby commented Oct 26, 2017

This is expected - AutoDateLocator can't choose a specific Locator until it is associated with an axis. I'll keep this open so we can add a better error message.

@dstansby
Copy link
Member

I think what I said above is wrong... will have a look at this issue properly soon

@dstansby dstansby self-assigned this Oct 27, 2017
@dstansby dstansby added this to the v2.2 milestone Oct 29, 2017
@tacaswell tacaswell modified the milestones: v2.2, v2.1.1 Oct 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants