Screenshot instructions:
Windows
Mac
Red Hat Linux
Ubuntu
Click URL instructions:
Rightclick on ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)
From: Joe Kington <jkington@wi...>  20100820 22:18:22
Attachments:
Message as HTML

Hi, I've recently noticed that setting the ytick locations on an image plot changes the yaxis limits, while changing the xtick locations does not change the xaxis limits. I wouldn't have expected either to change the axis limits, but it seems quite inconsistent that the yaxis and xaxis behave differently in this situation. The axis limits are easily restored by a call to "ax.axis('image')", but this seems unnecessary. A very quick search of the bug tracker doesn't reveal anything matching this description... Is this expected behavior or a bug? As an example, setting the ytick locations changes the yaxis limits: import numpy as np import matplotlib.pyplot as plt num = 10 data = np.arange(num**2).reshape((num,num)) fig = plt.figure() ax = fig.add_subplot(111) cax = ax.imshow(data) ax.set_yticks(range(num//2)) fig.show() However, setting the xtick locations does not change the axis limits... import numpy as np import matplotlib.pyplot as plt num = 10 data = np.arange(num**2).reshape((num,num)) fig = plt.figure() ax = fig.add_subplot(111) cax = ax.imshow(data) ax.set_xticks(range(num//2)) fig.show() As a reference, I'm running matplotlib 1.0.0 with python 2.7.0 on a 64bit Linux (kernel 2.6.31) machine. I can confirm this on python 2.6 and matplotlib 0.99 as well, though. If this isn't expected behavior, I'll be glad to open a bug report. Thanks! Joe 
From: Eric Firing <efiring@ha...>  20100821 08:13:53

On 08/20/2010 12:18 PM, Joe Kington wrote: > Hi, > > I've recently noticed that setting the ytick locations on an image plot > changes the yaxis limits, while changing the xtick locations does not > change the xaxis limits. I wouldn't have expected either to change the > axis limits, but it seems quite inconsistent that the yaxis and xaxis > behave differently in this situation. > > The axis limits are easily restored by a call to "ax.axis('image')", but > this seems unnecessary. > > A very quick search of the bug tracker doesn't reveal anything matching > this description... > > Is this expected behavior or a bug? > > As an example, setting the ytick locations changes the yaxis limits: > import numpy as np > import matplotlib.pyplot as plt > > num = 10 > data = np.arange(num**2).reshape((num,num)) > > fig = plt.figure() > ax = fig.add_subplot(111) > > cax = ax.imshow(data) > > ax.set_yticks(range(num//2)) > > fig.show() > > However, setting the xtick locations does not change the axis limits... > import numpy as np > import matplotlib.pyplot as plt > > num = 10 > data = np.arange(num**2).reshape((num,num)) > > fig = plt.figure() > ax = fig.add_subplot(111) > > cax = ax.imshow(data) > > ax.set_xticks(range(num//2)) > > fig.show() > > As a reference, I'm running matplotlib 1.0.0 with python 2.7.0 on a > 64bit Linux (kernel 2.6.31) machine. I can confirm this on python 2.6 > and matplotlib 0.99 as well, though. > > If this isn't expected behavior, I'll be glad to open a bug report. It's a bug. I think I have it fixed, but I need to do some more testing, so I won't commit anything tonight. Eric > > Thanks! > Joe > > > >  > This SF.net email is sponsored by > > Make an app they can't live without > Enter the BlackBerry Developer Challenge > http://p.sf.net/sfu/RIMdev2dev > > > > _______________________________________________ > Matplotlibusers mailing list > Matplotlibusers@... > https://lists.sourceforge.net/lists/listinfo/matplotlibusers 
From: Eric Firing <efiring@ha...>  20100821 18:35:10

On 08/20/2010 12:18 PM, Joe Kington wrote: > Hi, > > I've recently noticed that setting the ytick locations on an image plot > changes the yaxis limits, while changing the xtick locations does not > change the xaxis limits. I wouldn't have expected either to change the > axis limits, but it seems quite inconsistent that the yaxis and xaxis > behave differently in this situation. > > The axis limits are easily restored by a call to "ax.axis('image')", but > this seems unnecessary. > > A very quick search of the bug tracker doesn't reveal anything matching > this description... > > Is this expected behavior or a bug? > > As an example, setting the ytick locations changes the yaxis limits: > import numpy as np > import matplotlib.pyplot as plt > > num = 10 > data = np.arange(num**2).reshape((num,num)) > > fig = plt.figure() > ax = fig.add_subplot(111) > > cax = ax.imshow(data) > > ax.set_yticks(range(num//2)) > > fig.show() > > However, setting the xtick locations does not change the axis limits... > import numpy as np > import matplotlib.pyplot as plt > > num = 10 > data = np.arange(num**2).reshape((num,num)) > > fig = plt.figure() > ax = fig.add_subplot(111) > > cax = ax.imshow(data) > > ax.set_xticks(range(num//2)) > > fig.show() > > As a reference, I'm running matplotlib 1.0.0 with python 2.7.0 on a > 64bit Linux (kernel 2.6.31) machine. I can confirm this on python 2.6 > and matplotlib 0.99 as well, though. > > If this isn't expected behavior, I'll be glad to open a bug report. Joe, Thanks for the report. The fix is in svn 8652 and 8653. Eric > > Thanks! > Joe 
From: Joe Kington <jkington@wi...>  20100821 19:32:18
Attachments:
Message as HTML

Thanks for the amazingly quick turnaround! Joe On Sat, Aug 21, 2010 at 1:34 PM, Eric Firing <efiring@...> wrote: > On 08/20/2010 12:18 PM, Joe Kington wrote: > > Hi, > > > > I've recently noticed that setting the ytick locations on an image plot > > changes the yaxis limits, while changing the xtick locations does not > > change the xaxis limits. I wouldn't have expected either to change the > > axis limits, but it seems quite inconsistent that the yaxis and xaxis > > behave differently in this situation. > > > > The axis limits are easily restored by a call to "ax.axis('image')", but > > this seems unnecessary. > > > > A very quick search of the bug tracker doesn't reveal anything matching > > this description... > > > > Is this expected behavior or a bug? > > > > As an example, setting the ytick locations changes the yaxis limits: > > import numpy as np > > import matplotlib.pyplot as plt > > > > num = 10 > > data = np.arange(num**2).reshape((num,num)) > > > > fig = plt.figure() > > ax = fig.add_subplot(111) > > > > cax = ax.imshow(data) > > > > ax.set_yticks(range(num//2)) > > > > fig.show() > > > > However, setting the xtick locations does not change the axis limits... > > import numpy as np > > import matplotlib.pyplot as plt > > > > num = 10 > > data = np.arange(num**2).reshape((num,num)) > > > > fig = plt.figure() > > ax = fig.add_subplot(111) > > > > cax = ax.imshow(data) > > > > ax.set_xticks(range(num//2)) > > > > fig.show() > > > > As a reference, I'm running matplotlib 1.0.0 with python 2.7.0 on a > > 64bit Linux (kernel 2.6.31) machine. I can confirm this on python 2.6 > > and matplotlib 0.99 as well, though. > > > > If this isn't expected behavior, I'll be glad to open a bug report. > > Joe, > > Thanks for the report. The fix is in svn 8652 and 8653. > > Eric > > > > > Thanks! > > Joe > > >  > This SF.net email is sponsored by > > Make an app they can't live without > Enter the BlackBerry Developer Challenge > http://p.sf.net/sfu/RIMdev2dev > _______________________________________________ > Matplotlibusers mailing list > Matplotlibusers@... > https://lists.sourceforge.net/lists/listinfo/matplotlibusers > 
Sign up for the SourceForge newsletter:
No, thanks