Re: Matplotlib X-axis timezone trouble

2015-07-10 Thread Peter Pearson
On Thu, 09 Jul 2015 19:50:33 GMT, Tony the Tiger wrote: > On Tue, 30 Jun 2015 00:56:26 +, Peter Pearson wrote: > >> If I use timezone US/Central, I get the same (bad) plot. > > Perhaps this can help?: > http://stackoverflow.com/questions/1301493/setting-timezone-in-python Yes, thanks. As I s

Re: Matplotlib X-axis timezone trouble [SOLVED]

2015-07-04 Thread Peter Pearson
On Sat, 04 Jul 2015 07:29:45 +0300, Akira Li <4kir4...@gmail.com> wrote: > Peter Pearson writes: > >> The following code produces a plot with a line running from (9:30, 0) to >> (10:30, 1), not from (8:30, 0) to (9:30, 1) as I desire. >> >> If I use timezone None instead of pacific, the plot is as

Re: Matplotlib X-axis timezone trouble

2015-07-03 Thread Akira Li
Peter Pearson writes: > The following code produces a plot with a line running from (9:30, 0) to > (10:30, 1), not from (8:30, 0) to (9:30, 1) as I desire. > > If I use timezone None instead of pacific, the plot is as desired, but > of course that doesn't solve the general problem of which this i

Re: Datetime timezone trouble (was: Matplotlib X-axis timezone trouble)

2015-07-01 Thread Peter Pearson
On Wed, 1 Jul 2015 10:55:02 -0600, Ian Kelly wrote: > On Wed, Jul 1, 2015 at 10:36 AM, Peter Pearson [wrote]: [snip] >> Here's a very simple demonstration that either something is wrong >> or I don't understand how datetime and tzinfo are supposed to work: >> >> $ python >> Python 2.7.3 (default,

Re: Datetime timezone trouble (was: Matplotlib X-axis timezone trouble)

2015-07-01 Thread Chris Angelico
On Thu, Jul 2, 2015 at 2:36 AM, Peter Pearson wrote: > On Wed, 1 Jul 2015 17:15:38 +1000, Chris Angelico wrote: >> >> Interestingly, when I tried this (pytz version 2015.4, Python 2.7.9, >> Debian Jessie), I saw utcoffset() showing (-1, 58020) for both. That >> seems... odd. And I can't fault you

Re: Datetime timezone trouble (was: Matplotlib X-axis timezone trouble)

2015-07-01 Thread Ian Kelly
On Wed, Jul 1, 2015 at 10:36 AM, Peter Pearson wrote: > On Wed, 1 Jul 2015 17:15:38 +1000, Chris Angelico wrote: >> >> Interestingly, when I tried this (pytz version 2015.4, Python 2.7.9, >> Debian Jessie), I saw utcoffset() showing (-1, 58020) for both. That >> seems... odd. And I can't fault yo

Datetime timezone trouble (was: Matplotlib X-axis timezone trouble)

2015-07-01 Thread Peter Pearson
On Wed, 1 Jul 2015 17:15:38 +1000, Chris Angelico wrote: > > Interestingly, when I tried this (pytz version 2015.4, Python 2.7.9, > Debian Jessie), I saw utcoffset() showing (-1, 58020) for both. That > seems... odd. And I can't fault your dates - those definitely ought to > be easily inside and e

Re: Matplotlib X-axis timezone trouble

2015-07-01 Thread Chris Angelico
On Wed, Jul 1, 2015 at 3:50 PM, Peter Pearson wrote: > But look: > > >>> from datetime import datetime > >>> import pytz > >>> pacific = pytz.timezone("US/Pacific") > >>> dt1 = datetime(2006, 11, 21, 16, 30, tzinfo=pacific) # no DST > >>> dt2 = datetime(2006, 6, 14, 13, 0, tzin

Re: Matplotlib X-axis timezone trouble

2015-06-30 Thread Peter Pearson
On 30 Jun 2015 00:56:26 GMT, Peter Pearson wrote: > The following code produces a plot with a line running from (9:30, 0) to > (10:30, 1), not from (8:30, 0) to (9:30, 1) as I desire. > > If I use timezone None instead of pacific, the plot is as desired, but > of course that doesn't solve the gene

Re: Matplotlib X-axis timezone trouble

2015-06-30 Thread Chris Angelico
On Wed, Jul 1, 2015 at 2:42 AM, Peter Pearson wrote: > I'm just glad I don't have to worry about the distinctions among > UTC, GMT, TAI, and UT1. Fortunately, that's often the case. GMT can be ignored, and the other three differ by less seconds than most humans ever care about. If you're scheduli

Re: Matplotlib X-axis timezone trouble

2015-06-30 Thread Peter Pearson
On Tue, 30 Jun 2015 17:01:15 +1000, Chris Angelico wrote: > On Tue, Jun 30, 2015 at 2:49 PM, Peter Pearson > wrote: >> Time zones teem with sneaky software problems, and so does daylight-saving >> time, so this problem might strain my brain. Maybe it's going to turn >> out that my expectations ar

Re: Matplotlib X-axis timezone trouble

2015-06-30 Thread Chris Angelico
On Tue, Jun 30, 2015 at 2:49 PM, Peter Pearson wrote: > Time zones teem with sneaky software problems, and so does daylight-saving > time, so this problem might strain my brain. Maybe it's going to turn > out that my expectations are unreasonable . . . as in, "Well, smarty pants, > how do you wan

Re: Matplotlib X-axis timezone trouble

2015-06-29 Thread Peter Pearson
On Tue, 30 Jun 2015 04:03:57 +0200, Laura Creighton wrote: > In a message of 30 Jun 2015 00:56:26 +, Peter Pearson writes: >>The following code produces a plot with a line running from (9:30, 0) to >>(10:30, 1), not from (8:30, 0) to (9:30, 1) as I desire. >> >>If I use timezone None instead o

Re: Matplotlib X-axis timezone trouble

2015-06-29 Thread Peter Pearson
On Tue, 30 Jun 2015 12:11:31 +1000, Chris Angelico wrote: > On Tue, Jun 30, 2015 at 10:56 AM, Peter Pearson > wrote: >> The following code produces a plot with a line running from (9:30, 0) to >> (10:30, 1), not from (8:30, 0) to (9:30, 1) as I desire. >> >> pacific = pytz.timezone("US/Pacific") >

Re: Matplotlib X-axis timezone trouble

2015-06-29 Thread Chris Angelico
On Tue, Jun 30, 2015 at 10:56 AM, Peter Pearson wrote: > The following code produces a plot with a line running from (9:30, 0) to > (10:30, 1), not from (8:30, 0) to (9:30, 1) as I desire. > > pacific = pytz.timezone("US/Pacific") > plt.plot([datetime.datetime(2014, 10, 7, 8, 30, tzinfo=pacific),

Re: Matplotlib X-axis timezone trouble

2015-06-29 Thread Laura Creighton
In a message of 30 Jun 2015 00:56:26 +, Peter Pearson writes: >The following code produces a plot with a line running from (9:30, 0) to >(10:30, 1), not from (8:30, 0) to (9:30, 1) as I desire. > >If I use timezone None instead of pacific, the plot is as desired, but >of course that doesn't sol

Matplotlib X-axis timezone trouble

2015-06-29 Thread Peter Pearson
The following code produces a plot with a line running from (9:30, 0) to (10:30, 1), not from (8:30, 0) to (9:30, 1) as I desire. If I use timezone None instead of pacific, the plot is as desired, but of course that doesn't solve the general problem of which this is a much-reduced example. If I u