Comments (3)
Confirming with:
>>> import matplotlib.pyplot as plt
>>> import matplotlib.dates
>>> import datetime
>>>
>>> t = datetime.datetime.now().date()
>>> left_varr = range(10)
>>> right_varr = range(10)
>>> right_varr.reverse()
>>> tarr = matplotlib.dates.date2num([t + datetime.timedelta(days=i) for i in right_varr])
>>> fig = plt.figure()
>>> ax1 = fig.add_subplot(1,1,1)
>>>
>>> ax2 = ax1.twinx()
>>> ax2.plot_date(tarr, right_varr)
[<matplotlib.lines.Line2D object at 0x1025374d0>]
>>> fig.canvas.draw()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/pelson/dev/matplotlib/lib/matplotlib/backends/backend_agg.py", line 433, in draw
self.figure.draw(self.renderer)
File "/Users/pelson/dev/matplotlib/lib/matplotlib/artist.py", line 55, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
File "/Users/pelson/dev/matplotlib/lib/matplotlib/figure.py", line 927, in draw
func(*args)
File "/Users/pelson/dev/matplotlib/lib/matplotlib/artist.py", line 55, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
File "/Users/pelson/dev/matplotlib/lib/matplotlib/axes.py", line 1998, in draw
a.draw(renderer)
File "/Users/pelson/dev/matplotlib/lib/matplotlib/artist.py", line 55, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
File "/Users/pelson/dev/matplotlib/lib/matplotlib/axis.py", line 1047, in draw
ticks_to_draw = self._update_ticks(renderer)
File "/Users/pelson/dev/matplotlib/lib/matplotlib/axis.py", line 937, in _update_ticks
tick_tups = [ t for t in self.iter_ticks()]
File "/Users/pelson/dev/matplotlib/lib/matplotlib/axis.py", line 884, in iter_ticks
majorLocs = self.major.locator()
File "/Users/pelson/dev/matplotlib/lib/matplotlib/dates.py", line 752, in __call__
self.refresh()
File "/Users/pelson/dev/matplotlib/lib/matplotlib/dates.py", line 761, in refresh
dmin, dmax = self.viewlim_to_dt()
File "/Users/pelson/dev/matplotlib/lib/matplotlib/dates.py", line 533, in viewlim_to_dt
return num2date(vmin, self.tz), num2date(vmax, self.tz)
File "/Users/pelson/dev/matplotlib/lib/matplotlib/dates.py", line 292, in num2date
if not cbook.iterable(x): return _from_ordinalf(x, tz)
File "/Users/pelson/dev/matplotlib/lib/matplotlib/dates.py", line 206, in _from_ordinalf
dt = datetime.datetime.fromordinal(ix)
ValueError: ordinal must be >= 1
On master just before the 1.2.x freeze.
from matplotlib.
This might be useful.
from matplotlib.
It looks like this has been fixed. Using the example above from @pelson, I can't reproduce it with 1.2.x or master. Closing.
from matplotlib.
Related Issues (20)
- [TST] Upcoming dependency test failures
- [Bug]: Useless recursive group in SVG output when using path_effects HOT 4
- [ENH]: Fonts searching logic HOT 3
- [ENH]: callable color map of Plasma with Deuteranopia colourblind filter HOT 3
- [Bug]: incorrect placement of superscripts on large delimiters HOT 1
- [MNT]: Make the colormap naming work with any capitalization
- [Bug]: GridSpec do not type check as Iterable in zip HOT 7
- [ENH]: Add an easy way to plot an infinite half space (e.g. with a HalfSpace patch)
- [Bug]: rcParams["axes.labelcolor"] treats "none" and "None" differently
- [MNT]: Inconsistent use of "inherit" and "auto" for color fallback in rcParams HOT 3
- [ENH]: axes.labelcolor should use text.color by default HOT 3
- [ENH]: Automatically trim the time on the x axis HOT 20
- [Bug]: Pyplot internal bug HOT 1
- [Bug]: PolygonSelector should hide itself when zoom/pan is active HOT 6
- [Bug]: Removing tools from the toolmanager that are not on the toolbar triggers an exception
- [TST] Upcoming dependency test failures
- [Doc]: `get_figure` may return a `SubFigure` HOT 7
- [ENH]: Make the font family "Computer Modern" more accessible HOT 1
- [Bug]: Log scaled barplots in PDF result in infinite rectangles HOT 3
- [Bug]: `Path.cleaned()` always returns a closed path HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from matplotlib.