Skip,
I am not at all familiar with dates in matplotlib, but what does plt.xlim()
yield? Or are the limits not updated before calling the tick formatter?
-Sterling
On Jul 12, 2013, at 8:49AM, Skip Montanaro wrote:
> Let me return to my FuncFormatter usage. As I indicated in an earlier
> post
> I am not at all familiar with dates in matplotlib, but what does plt.xlim()
> yield? Or are the limits not updated before calling the tick formatter?
Bingo! I changed "plt" to "pylab" and now I have access to the x
range of the current viewport.
Thanks,
Skip
---
Let me return to my FuncFormatter usage. As I indicated in an earlier
post, I made a single format decision based on the x range of the
entire data set. The decision code was straightforward:
x_delta = x_range[1] - x_range[0]
if x_delta > int(1.5 * 365) * ONE_DAY:
xfmt = "%Y-%m-%
On Fri, Jul 12, 2013 at 8:47 AM, Skip Montanaro wrote:
> Is there some way to get the x axis to display
> fractions of a second? There is no strftime format character
> corresponding to that. (I proposed one on python-dev several years
> ago, but I don't think it was ever adopted.)
My memory fa
> You're suggesting that I shouldn't have to do anything with formatters
> and locators if my X values are datetime objects? Maybe I should
> simply scrub any locator/formatter initialization altogether.
Did that. Works just as before with my custom FuncFormatter, and with
my explicit AutoDateFo
> Are you definately passing through datetime objects, or are you passing
> through the datetime "ordinals" / Julian time?
Definitely datetime objects:
if xtime:
min_x = datetime.datetime(, 12, 31, 23, 59, 59)
max_x = datetime.datetime(1970, 1, 1, 0, 0, 0)
def pars
This surprises me as the AutoDateFormatter automatically kicks in once you
pass through some datetime objects, and the AutoDateFormatter & Locator do
the right thing when zooming (the format changes depending on the temporal
resolution). For example, the following code behaves nicely when I zoom in
> I have a small matplotlib app I wrote to plot columns of a CSV files.
> The X axis is almost always time. Once displayed, I will often zoom in
> on a small patch of a plot. I'm currently selecting the strftime
> format based on the original time range of the input. As I zoom in,
> however, that
I have a small matplotlib app I wrote to plot columns of a CSV files.
The X axis is almost always time. Once displayed, I will often zoom in
on a small patch of a plot. I'm currently selecting the strftime
format based on the original time range of the input. As I zoom in,
however, that doesn't w