Alex S wrote:
Hi there, does anyone know if there's a simple way to set an axis limit to
a date? "viewlim_to_dt()" looks promising, but I can't figure out how to
Thanks a lot,
I've done something like this in the past:
ax.set_xlim( ( min_val, max_val ) )
# improve formatting
fig.autofmt_xdate( bottom = 0.20000000000000001, rotation = 30,
ha = 'right' )
where min_val and max_val are values from
matplotlib.dates.date2num( dt ) because
dt is a datetime object, which is not the format matplotlib
So, setting the xlimit ( or ylimit ) using the values expected by
matplotlib manually is one option.
*d* is either a :class:`datetime` instance or a sequence of datetimes.
Return value is a floating point number (or sequence of floats)
which gives number of days (fraction part represents hours,
minutes, seconds) since 0001-01-01 00:00:00 UTC.
View this message in context: http://old.nabble.com/xlim-with-dates-tp27881612p27882067.html
Sent from the matplotlib - users mailing list archive at Nabble.com.