|
From: Skip M. <sk...@po...> - 2013-07-12 15:49:51
|
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-%d"
elif x_delta > 2 * ONE_DAY:
xfmt = "%m/%d\n%H:%M"
elif x_delta < 2 * ONE_HOUR:
xfmt = "%H:%M:%S"
else:
xfmt = "%H:%M"
How do I compute x_delta as it relates to the currently visible
window? In the above code, x_range represents the x range of my
entire data set.
Thx,
Skip
|