Re: [Matplotlib-users] imlim in ax.imshow

2012-10-04 Thread Michael Aye
On 2012-10-02 20:15:51 +, Damon McDougall said:

> On Tue, Oct 2, 2012 at 9:09 PM, Eric Firing 
>  wrote:
>> On 2012/10/02 9:21 AM, Michael Aye wrote:
> 
 How nice of you to ask! ;)
 Indeed: I had the case that image arrays inside an ImageGrid where
 shown with some white overhead area around, e.g. for an image of 100
 pixels on the x-axis, the imshow resulted in an x-axis that went from
 -10 to 110. I was looking for a simple way to suppress that behavior
 and let imshow instead use the exact image extent. I believe that the
 plot command has such a flag, hasn't it? (I.e. to use the exact xdata
 range and not try to beautify the plot?
 
 Michael
 
>>> 
>>> Is the 'extent' keyword what you're looking for?
>>> 
>> 
>> No, because it needs detail. I was looking for a boolean switch that
 basically says: Respect the data, not beauty.
> 
> I don't understand what you mean by 'beauty'. If your image is 100
> pixels wide and 50 pixels tall, what is it about extent=[0,100,0,50]
> that doesn't do what you want?
> 
 As I wrote, that's not what is happening. I get extent=[-10,110,0,50].
 
 
 Which version of matplotlib are you using?  Also, are you on a 32-bit
 machine or a 64-bit machine.  This might be related to a bug we have
 seen recently.
>>> 
>>> I am using mpl 1.1.0 from EPD 7.3-2 on a 64-bit Mac OSX.
>>> 
>>> Thanks for the effort Damon. I should have been starting with an
>>> example script from the beginning.
>>> I believe the problem appears only for subplots in the case of sharex
>>> =sharey = True:
>> 
>> Aha!  This is a real bug. It may take a bit of work to track it down.
>> Would you enter it, with this test script, as a github issue, please?
>> 
>> Thank you.
>> 
>> Eric
>> 
>>> 
>>> from matplotlib.pyplot import show, subplots
>>> from numpy import arange, array
>>> 
>>> arr = arange(1).reshape(100,100)
>>> l = [arr,arr,arr,arr]
>>> narr = array(l)
>>> 
>>> fig, axes = subplots(2,2,sharex=True,sharey=True)
>>> 
>>> for ax,im in zip(axes.flatten(),narr):
>>> ax.imshow(im)
>>> 
>>> show()
>>> 
>>> One can see that all the 4 axes show the array with an extent of
>>> [-10,110, 0, 100] here.
>>> 
>>> Michael
>>> 
>>> 
 
 Ben Root
 
 --
 Don't let slow site performance ruin your business. Deploy New Relic APM
 Deploy New Relic app performance management and know exactly
 what is happening inside your Ruby, Python, PHP, Java, and .NET app
 Try New Relic at no cost today and get our sweet Data Nerd shirt too!
 http://p.sf.net/sfu/newrelic-dev2dev
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>> 
>>> 
>>> 
>>> 
>>> --
>>> Don't let slow site performance ruin your business. Deploy New Relic APM
>>> Deploy New Relic app performance management and know exactly
>>> what is happening inside your Ruby, Python, PHP, Java, and .NET app
>>> Try New Relic at no cost today and get our sweet Data Nerd shirt too!
>>> http://p.sf.net/sfu/newrelic-dev2dev
>>> ___
>>> Matplotlib-users mailing list
>>> Matplotlib-users@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>> 
>> 
>> 
>> --
>> Don't let slow site performance ruin your business. Deploy New Relic APM
>> Deploy New Relic app performance management and know exactly
>> what is happening inside your Ruby, Python, PHP, Java, and .NET app
>> Try New Relic at no cost today and get our sweet Data Nerd shirt too!
>> http://p.sf.net/sfu/newrelic-dev2dev
>> ___
>> Matplotlib-users mailing list
>> Matplotlib-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
> The extent keyword is something I put in as second nature. You'll need
> it if your x-range or y-range is something other than the the number
> of pixels in each dimension. In this case, it can safely be removed,
> yes. Thanks for pointing that out.
> 
> If you want to share axes, that is still possible:
> 
> import matplotlib.pyplot as plt
> from numpy import arange, array
> 
> arr = arange(1).reshape(100,100)
> l = [arr,arr,arr,arr]
> narr = array(l)
> 
> axes = []
> fig = plt.figure()
> for i in range(4):
> if i == 0:
> axes.append(fig.add_subplot(2, 2, i))
> if i > 0:
> axes.append(fig.add_subplot(2, 2, i, sharex=axes[0], sharey=axes[0]))
> 
> for ax, im in zip(axes, narr):
> ax.imshow(im, extent=[0,100,0,100])
> 
> plt.show()

This code fails to share the axe

Re: [Matplotlib-users] imlim in ax.imshow

2012-10-04 Thread Michael Aye
On 2012-10-02 20:09:34 +, Eric Firing said:

> On 2012/10/02 9:21 AM, Michael Aye wrote:
 
>>> How nice of you to ask! ;)
>>> Indeed: I had the case that image arrays inside an ImageGrid where
>>> shown with some white overhead area around, e.g. for an image of 100
>>> pixels on the x-axis, the imshow resulted in an x-axis that went from
>>> -10 to 110. I was looking for a simple way to suppress that behavior
>>> and let imshow instead use the exact image extent. I believe that the
>>> plot command has such a flag, hasn't it? (I.e. to use the exact xdata
>>> range and not try to beautify the plot?
>>> 
>>> Michael
>>> 
>> 
>> Is the 'extent' keyword what you're looking for?
>> 
> 
> No, because it needs detail. I was looking for a boolean switch that
>>> basically says: Respect the data, not beauty.
 
 I don't understand what you mean by 'beauty'. If your image is 100
 pixels wide and 50 pixels tall, what is it about extent=[0,100,0,50]
 that doesn't do what you want?
 
>>> As I wrote, that's not what is happening. I get extent=[-10,110,0,50].
>>> 
>>> 
>>> Which version of matplotlib are you using?  Also, are you on a 32-bit
>>> machine or a 64-bit machine.  This might be related to a bug we have
>>> seen recently.
>> 
>> I am using mpl 1.1.0 from EPD 7.3-2 on a 64-bit Mac OSX.
>> 
>> Thanks for the effort Damon. I should have been starting with an
>> example script from the beginning.
>> I believe the problem appears only for subplots in the case of sharex
>> =sharey = True:
> 
> Aha!  This is a real bug. It may take a bit of work to track it down.
> Would you enter it, with this test script, as a github issue, please?

Done.
https://github.com/matplotlib/matplotlib/issues/1325

Cheers,
Michael

> 
> Thank you.
> 
> Eric
> 
>> 
>> from matplotlib.pyplot import show, subplots
>> from numpy import arange, array
>> 
>> arr = arange(1).reshape(100,100)
>> l = [arr,arr,arr,arr]
>> narr = array(l)
>> 
>> fig, axes = subplots(2,2,sharex=True,sharey=True)
>> 
>> for ax,im in zip(axes.flatten(),narr):
>> ax.imshow(im)
>> 
>> show()
>> 
>> One can see that all the 4 axes show the array with an extent of
>> [-10,110, 0, 100] here.
>> 
>> Michael
>> 
>> 
>>> 
>>> Ben Root
>>> 
>>> --
>>> Don't let slow site performance ruin your business. Deploy New Relic APM
>>> Deploy New Relic app performance management and know exactly
>>> what is happening inside your Ruby, Python, PHP, Java, and .NET app
>>> Try New Relic at no cost today and get our sweet Data Nerd shirt too!
>>> http://p.sf.net/sfu/newrelic-dev2dev
>>> ___
>>> Matplotlib-users mailing list
>>> Matplotlib-users@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>> 
>> 
>> 
>> 
>> --
>> Don't let slow site performance ruin your business. Deploy New Relic APM
>> Deploy New Relic app performance management and know exactly
>> what is happening inside your Ruby, Python, PHP, Java, and .NET app
>> Try New Relic at no cost today and get our sweet Data Nerd shirt too!
>> http://p.sf.net/sfu/newrelic-dev2dev
>> ___
>> Matplotlib-users mailing list
>> Matplotlib-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>> 
> 
> 
> --
> Don't let slow site performance ruin your business. Deploy New Relic APM
> Deploy New Relic app performance management and know exactly
> what is happening inside your Ruby, Python, PHP, Java, and .NET app
> Try New Relic at no cost today and get our sweet Data Nerd shirt too!
> http://p.sf.net/sfu/newrelic-dev2dev




--
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] imlim in ax.imshow

2012-10-02 Thread Eric Firing
On 2012/10/02 9:21 AM, Michael Aye wrote:
>>>
>> How nice of you to ask! ;)
>> Indeed: I had the case that image arrays inside an ImageGrid where
>> shown with some white overhead area around, e.g. for an image of 100
>> pixels on the x-axis, the imshow resulted in an x-axis that went from
>> -10 to 110. I was looking for a simple way to suppress that behavior
>> and let imshow instead use the exact image extent. I believe that the
>> plot command has such a flag, hasn't it? (I.e. to use the exact xdata
>> range and not try to beautify the plot?
>>
>> Michael
>>
>
> Is the 'extent' keyword what you're looking for?
>

 No, because it needs detail. I was looking for a boolean switch that
>> basically says: Respect the data, not beauty.
>>>
>>> I don't understand what you mean by 'beauty'. If your image is 100
>>> pixels wide and 50 pixels tall, what is it about extent=[0,100,0,50]
>>> that doesn't do what you want?
>>>
>> As I wrote, that's not what is happening. I get extent=[-10,110,0,50].
>>
>>
>> Which version of matplotlib are you using?  Also, are you on a 32-bit
>> machine or a 64-bit machine.  This might be related to a bug we have
>> seen recently.
>
> I am using mpl 1.1.0 from EPD 7.3-2 on a 64-bit Mac OSX.
>
> Thanks for the effort Damon. I should have been starting with an
> example script from the beginning.
> I believe the problem appears only for subplots in the case of sharex
> =sharey = True:

Aha!  This is a real bug. It may take a bit of work to track it down. 
Would you enter it, with this test script, as a github issue, please?

Thank you.

Eric

>
> from matplotlib.pyplot import show, subplots
> from numpy import arange, array
>
> arr = arange(1).reshape(100,100)
> l = [arr,arr,arr,arr]
> narr = array(l)
>
> fig, axes = subplots(2,2,sharex=True,sharey=True)
>
> for ax,im in zip(axes.flatten(),narr):
>  ax.imshow(im)
>
> show()
>
> One can see that all the 4 axes show the array with an extent of
> [-10,110, 0, 100] here.
>
> Michael
>
>
>>
>> Ben Root
>>
>> --
>> Don't let slow site performance ruin your business. Deploy New Relic APM
>> Deploy New Relic app performance management and know exactly
>> what is happening inside your Ruby, Python, PHP, Java, and .NET app
>> Try New Relic at no cost today and get our sweet Data Nerd shirt too!
>> http://p.sf.net/sfu/newrelic-dev2dev
>> ___
>> Matplotlib-users mailing list
>> Matplotlib-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
>
>
> --
> Don't let slow site performance ruin your business. Deploy New Relic APM
> Deploy New Relic app performance management and know exactly
> what is happening inside your Ruby, Python, PHP, Java, and .NET app
> Try New Relic at no cost today and get our sweet Data Nerd shirt too!
> http://p.sf.net/sfu/newrelic-dev2dev
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>


--
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] imlim in ax.imshow

2012-10-02 Thread Michael Aye
On 2012-10-02 19:49:16 +, Damon McDougall said:

> On Tue, Oct 2, 2012 at 8:33 PM, Michael Aye 
>  wrote:
>> 
> How nice of you to ask! ;)
> Indeed: I had the case that image arrays inside an ImageGrid where
> shown with some white overhead area around, e.g. for an image of 100
> pixels on the x-axis, the imshow resulted in an x-axis that went from
> -10 to 110. I was looking for a simple way to suppress that behavior
> and let imshow instead use the exact image extent. I believe that the
> plot command has such a flag, hasn't it? (I.e. to use the exact xdata
> range and not try to beautify the plot?
> 
> Michael
 
 Is the 'extent' keyword what you're looking for?
 
>>> 
>>> No, because it needs detail. I was looking for a boolean switch that
>>> basically says: Respect the data, not beauty.
>> 
>> I don't understand what you mean by 'beauty'. If your image is 100
>> pixels wide and 50 pixels tall, what is it about extent=[0,100,0,50]
>> that doesn't do what you want?
>> 
> As I wrote, that's not what is happening. I get extent=[-10,110,0,50].
> 
> 
 
 The following script works for me:
 
 import numpy as np
 import matplotlib.pyplot as plt
 
 image = np.random.random((100,50))
 
 fig = plt.figure()
 ax = fig.add_subplot(1, 1, 1)
 ax.imshow(image, extent=[0,100,0,50])
 plt.show()
 
 
>>> 
>>> I think the problem is that Michael is using ImageGrid, and apparently
>>> it is not using the tight autoscaling that imshow normally uses by default.
>> 
>> I might have confused where I had the problem as I was trying out many
>> a'things yesterday, so today I only can reproduce it with subplots. Can
>> I activate tight autoscaling somehow? tight_layout only influences the
>> axes towards each-other not the imshows itself.
>> 
>> 
>>> 
>>> Eric
>>> 
>>> --
>>> Don't let slow site performance ruin your business. Deploy New Relic APM
>>> Deploy New Relic app performance management and know exactly
>>> what is happening inside your Ruby, Python, PHP, Java, and .NET app
>>> Try New Relic at no cost today and get our sweet Data Nerd shirt too!
>>> http://p.sf.net/sfu/newrelic-dev2dev
>> 
>> 
>> 
>> 
>> --
>> Don't let slow site performance ruin your business. Deploy New Relic APM
>> Deploy New Relic app performance management and know exactly
>> what is happening inside your Ruby, Python, PHP, Java, and .NET app
>> Try New Relic at no cost today and get our sweet Data Nerd shirt too!
>> http://p.sf.net/sfu/newrelic-dev2dev
>> ___
>> Matplotlib-users mailing list
>> Matplotlib-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
> I think you may have encountered a bug, as Ben pointed out. Here's a 
> workaround:
> 
> import matplotlib
> matplotlib.use('macosx')
> import matplotlib.pyplot as plt
> from numpy import arange, array
> 
> arr = arange(1).reshape(100,100)
> l = [arr,arr,arr,arr]
> narr = array(l)
> 
> axes = []
> fig = plt.figure()
> for i in range(4):
> axes.append(fig.add_subplot(2, 2, i))
> 
> for ax, im in zip(axes, narr):
> ax.imshow(im, extent=[0,100,0,100])
> 
> plt.show()

Interestingly, providing the extent does not help using subplots.
And your way of creating the subplots does not have the bug in the 
first place. Removing the extent parameter from this still plots fine.





--
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] imlim in ax.imshow

2012-10-02 Thread Damon McDougall
On Tue, Oct 2, 2012 at 8:33 PM, Michael Aye  wrote:
>
 How nice of you to ask! ;)
 Indeed: I had the case that image arrays inside an ImageGrid where
 shown with some white overhead area around, e.g. for an image of 100
 pixels on the x-axis, the imshow resulted in an x-axis that went from
 -10 to 110. I was looking for a simple way to suppress that behavior
 and let imshow instead use the exact image extent. I believe that the
 plot command has such a flag, hasn't it? (I.e. to use the exact xdata
 range and not try to beautify the plot?

 Michael
>>>
>>> Is the 'extent' keyword what you're looking for?
>>>
>>
>> No, because it needs detail. I was looking for a boolean switch that
>> basically says: Respect the data, not beauty.
>
> I don't understand what you mean by 'beauty'. If your image is 100
> pixels wide and 50 pixels tall, what is it about extent=[0,100,0,50]
> that doesn't do what you want?
>
 As I wrote, that's not what is happening. I get extent=[-10,110,0,50].


>>>
>>> The following script works for me:
>>>
>>> import numpy as np
>>> import matplotlib.pyplot as plt
>>>
>>> image = np.random.random((100,50))
>>>
>>> fig = plt.figure()
>>> ax = fig.add_subplot(1, 1, 1)
>>> ax.imshow(image, extent=[0,100,0,50])
>>> plt.show()
>>>
>>>
>>
>> I think the problem is that Michael is using ImageGrid, and apparently
>> it is not using the tight autoscaling that imshow normally uses by default.
>
> I might have confused where I had the problem as I was trying out many
> a'things yesterday, so today I only can reproduce it with subplots. Can
> I activate tight autoscaling somehow? tight_layout only influences the
> axes towards each-other not the imshows itself.
>
>
>>
>> Eric
>>
>> --
>> Don't let slow site performance ruin your business. Deploy New Relic APM
>> Deploy New Relic app performance management and know exactly
>> what is happening inside your Ruby, Python, PHP, Java, and .NET app
>> Try New Relic at no cost today and get our sweet Data Nerd shirt too!
>> http://p.sf.net/sfu/newrelic-dev2dev
>
>
>
>
> --
> Don't let slow site performance ruin your business. Deploy New Relic APM
> Deploy New Relic app performance management and know exactly
> what is happening inside your Ruby, Python, PHP, Java, and .NET app
> Try New Relic at no cost today and get our sweet Data Nerd shirt too!
> http://p.sf.net/sfu/newrelic-dev2dev
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users

I think you may have encountered a bug, as Ben pointed out. Here's a workaround:

import matplotlib
matplotlib.use('macosx')
import matplotlib.pyplot as plt
from numpy import arange, array

arr = arange(1).reshape(100,100)
l = [arr,arr,arr,arr]
narr = array(l)

axes = []
fig = plt.figure()
for i in range(4):
axes.append(fig.add_subplot(2, 2, i))

for ax, im in zip(axes, narr):
ax.imshow(im, extent=[0,100,0,100])

plt.show()

-- 
Damon McDougall
http://www.damon-is-a-geek.com
B2.39
Mathematics Institute
University of Warwick
Coventry
West Midlands
CV4 7AL
United Kingdom

--
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] imlim in ax.imshow

2012-10-02 Thread Michael Aye
 
>>> How nice of you to ask! ;)
>>> Indeed: I had the case that image arrays inside an ImageGrid where 
>>> shown with some white overhead area around, e.g. for an image of 100 
>>> pixels on the x-axis, the imshow resulted in an x-axis that went from 
>>> -10 to 110. I was looking for a simple way to suppress that behavior 
>>> and let imshow instead use the exact image extent. I believe that the 
>>> plot command has such a flag, hasn't it? (I.e. to use the exact xdata 
>>> range and not try to beautify the plot?
>>> 
>>> Michael
>> 
>> Is the 'extent' keyword what you're looking for?
>> 
> 
> No, because it needs detail. I was looking for a boolean switch that 
> basically says: Respect the data, not beauty.
 
 I don't understand what you mean by 'beauty'. If your image is 100
 pixels wide and 50 pixels tall, what is it about extent=[0,100,0,50]
 that doesn't do what you want?
 
>>> As I wrote, that's not what is happening. I get extent=[-10,110,0,50].
>>> 
>>> 
>> 
>> The following script works for me:
>> 
>> import numpy as np
>> import matplotlib.pyplot as plt
>> 
>> image = np.random.random((100,50))
>> 
>> fig = plt.figure()
>> ax = fig.add_subplot(1, 1, 1)
>> ax.imshow(image, extent=[0,100,0,50])
>> plt.show()
>> 
>> 
> 
> I think the problem is that Michael is using ImageGrid, and apparently
> it is not using the tight autoscaling that imshow normally uses by default.

I might have confused where I had the problem as I was trying out many 
a'things yesterday, so today I only can reproduce it with subplots. Can 
I activate tight autoscaling somehow? tight_layout only influences the 
axes towards each-other not the imshows itself.


> 
> Eric
> 
> --
> Don't let slow site performance ruin your business. Deploy New Relic APM
> Deploy New Relic app performance management and know exactly
> what is happening inside your Ruby, Python, PHP, Java, and .NET app
> Try New Relic at no cost today and get our sweet Data Nerd shirt too!
> http://p.sf.net/sfu/newrelic-dev2dev




--
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] imlim in ax.imshow

2012-10-02 Thread Michael Aye
> >
>  How nice of you to ask! ;)
>  Indeed: I had the case that image arrays inside an ImageGrid where 
> shown with some white overhead area around, e.g. for an image of 100 
> pixels on the x-axis, the imshow resulted in an x-axis that went from 
> -10 to 110. I was looking for a simple way to suppress that behavior 
> and let imshow instead use the exact image extent. I believe that the 
> plot command has such a flag, hasn't it? (I.e. to use the exact xdata 
> range and not try to beautify the plot?
> 
>  Michael
> 
> >>>
> >>> Is the 'extent' keyword what you're looking for?
> >>>
> >>
> >> No, because it needs detail. I was looking for a boolean switch that 
> basically says: Respect the data, not beauty.
> >
> > I don't understand what you mean by 'beauty'. If your image is 100
> > pixels wide and 50 pixels tall, what is it about extent=[0,100,0,50]
> > that doesn't do what you want?
> >
> As I wrote, that's not what is happening. I get extent=[-10,110,0,50].
> 
> 
> Which version of matplotlib are you using?  Also, are you on a 32-bit 
> machine or a 64-bit machine.  This might be related to a bug we have 
> seen recently.

I am using mpl 1.1.0 from EPD 7.3-2 on a 64-bit Mac OSX.

Thanks for the effort Damon. I should have been starting with an 
example script from the beginning.
I believe the problem appears only for subplots in the case of sharex 
=sharey = True:

from matplotlib.pyplot import show, subplots
from numpy import arange, array

arr = arange(1).reshape(100,100)
l = [arr,arr,arr,arr]
narr = array(l)

fig, axes = subplots(2,2,sharex=True,sharey=True)

for ax,im in zip(axes.flatten(),narr):
ax.imshow(im)

show()

One can see that all the 4 axes show the array with an extent of 
[-10,110, 0, 100] here.

Michael


> 
> Ben Root
> 
> --
> Don't let slow site performance ruin your business. Deploy New Relic APM
> Deploy New Relic app performance management and know exactly
> what is happening inside your Ruby, Python, PHP, Java, and .NET app
> Try New Relic at no cost today and get our sweet Data Nerd shirt too!
> http://p.sf.net/sfu/newrelic-dev2dev
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users




--
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] imlim in ax.imshow

2012-10-02 Thread Eric Firing
On 2012/10/02 9:11 AM, Damon McDougall wrote:
> On Tue, Oct 2, 2012 at 8:07 PM, K.-Michael Aye  wrote:
>>
>> On Oct 2, 2012, at 12:06 PM, Damon McDougall  
>> wrote:
>>
>>> On Tue, Oct 2, 2012 at 8:00 PM, K.-Michael Aye  
>>> wrote:

 On Oct 2, 2012, at 11:09 AM, Damon McDougall  
 wrote:

> On Tue, Oct 2, 2012 at 5:51 PM, K.-Michael Aye  
> wrote:
>>
>>
>> On Oct 2, 2012, at 6:33 AM, Damon McDougall  
>> wrote:
>>
>>> On Tue, Oct 2, 2012 at 2:19 PM, Benjamin Root  wrote:


 On Mon, Oct 1, 2012 at 7:20 PM, Michael Aye  
 wrote:
>
> Hi!
>
> I see that the function ax.imshow takes the parameter 'imlim' but in
> the source (status: EPD 7.3-2) it is not being used?
> So what is it for?
>
> Best regards,
> Michael
>
>

 Confirmed.  I don't see imlim anywhere except in the imshow() 
 signature.  I
 have no recollection of this parameter, so it might be from before my 
 time.

 Ben Root
>>>
>>> Is there some functionality you were looking for or were you just
>>> exploring the codebase?
>>>
>> How nice of you to ask! ;)
>> Indeed: I had the case that image arrays inside an ImageGrid where shown 
>> with some white overhead area around, e.g. for an image of 100 pixels on 
>> the x-axis, the imshow resulted in an x-axis that went from -10 to 110. 
>> I was looking for a simple way to suppress that behavior and let imshow 
>> instead use the exact image extent. I believe that the plot command has 
>> such a flag, hasn't it? (I.e. to use the exact xdata range and not try 
>> to beautify the plot?
>>
>> Michael
>>
>>
>>> --
>>> Damon McDougall
>>> http://www.damon-is-a-geek.com
>>> B2.39
>>> Mathematics Institute
>>> University of Warwick
>>> Coventry
>>> West Midlands
>>> CV4 7AL
>>> United Kingdom
>
> Is the 'extent' keyword what you're looking for?
>

 No, because it needs detail. I was looking for a boolean switch that 
 basically says: Respect the data, not beauty.
>>>
>>> I don't understand what you mean by 'beauty'. If your image is 100
>>> pixels wide and 50 pixels tall, what is it about extent=[0,100,0,50]
>>> that doesn't do what you want?
>>>
>> As I wrote, that's not what is happening. I get extent=[-10,110,0,50].
>>
>>
>>> --
>>> Damon McDougall
>>> http://www.damon-is-a-geek.com
>>> B2.39
>>> Mathematics Institute
>>> University of Warwick
>>> Coventry
>>> West Midlands
>>> CV4 7AL
>>> United Kingdom
>>
>
> The following script works for me:
>
> import numpy as np
> import matplotlib.pyplot as plt
>
> image = np.random.random((100,50))
>
> fig = plt.figure()
> ax = fig.add_subplot(1, 1, 1)
> ax.imshow(image, extent=[0,100,0,50])
> plt.show()
>
>

I think the problem is that Michael is using ImageGrid, and apparently 
it is not using the tight autoscaling that imshow normally uses by default.

Eric

--
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] imlim in ax.imshow

2012-10-02 Thread Benjamin Root
On Tue, Oct 2, 2012 at 3:07 PM, K.-Michael Aye wrote:

>
> On Oct 2, 2012, at 12:06 PM, Damon McDougall 
> wrote:
>
> > On Tue, Oct 2, 2012 at 8:00 PM, K.-Michael Aye 
> wrote:
> >>
> >> On Oct 2, 2012, at 11:09 AM, Damon McDougall 
> wrote:
> >>
> >>> On Tue, Oct 2, 2012 at 5:51 PM, K.-Michael Aye 
> wrote:
> 
> 
>  On Oct 2, 2012, at 6:33 AM, Damon McDougall <
> damon.mcdoug...@gmail.com> wrote:
> 
> > On Tue, Oct 2, 2012 at 2:19 PM, Benjamin Root 
> wrote:
> >>
> >>
> >> On Mon, Oct 1, 2012 at 7:20 PM, Michael Aye 
> wrote:
> >>>
> >>> Hi!
> >>>
> >>> I see that the function ax.imshow takes the parameter 'imlim' but
> in
> >>> the source (status: EPD 7.3-2) it is not being used?
> >>> So what is it for?
> >>>
> >>> Best regards,
> >>> Michael
> >>>
> >>>
> >>
> >> Confirmed.  I don't see imlim anywhere except in the imshow()
> signature.  I
> >> have no recollection of this parameter, so it might be from before
> my time.
> >>
> >> Ben Root
> >
> > Is there some functionality you were looking for or were you just
> > exploring the codebase?
> >
>  How nice of you to ask! ;)
>  Indeed: I had the case that image arrays inside an ImageGrid where
> shown with some white overhead area around, e.g. for an image of 100 pixels
> on the x-axis, the imshow resulted in an x-axis that went from -10 to 110.
> I was looking for a simple way to suppress that behavior and let imshow
> instead use the exact image extent. I believe that the plot command has
> such a flag, hasn't it? (I.e. to use the exact xdata range and not try to
> beautify the plot?
> 
>  Michael
> 
> 
> > --
> > Damon McDougall
> > http://www.damon-is-a-geek.com
> > B2.39
> > Mathematics Institute
> > University of Warwick
> > Coventry
> > West Midlands
> > CV4 7AL
> > United Kingdom
> >>>
> >>> Is the 'extent' keyword what you're looking for?
> >>>
> >>
> >> No, because it needs detail. I was looking for a boolean switch that
> basically says: Respect the data, not beauty.
> >
> > I don't understand what you mean by 'beauty'. If your image is 100
> > pixels wide and 50 pixels tall, what is it about extent=[0,100,0,50]
> > that doesn't do what you want?
> >
> As I wrote, that's not what is happening. I get extent=[-10,110,0,50].
>
>
>
Which version of matplotlib are you using?  Also, are you on a 32-bit
machine or a 64-bit machine.  This might be related to a bug we have seen
recently.

Ben Root
--
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] imlim in ax.imshow

2012-10-02 Thread Damon McDougall
On Tue, Oct 2, 2012 at 8:07 PM, K.-Michael Aye  wrote:
>
> On Oct 2, 2012, at 12:06 PM, Damon McDougall  
> wrote:
>
>> On Tue, Oct 2, 2012 at 8:00 PM, K.-Michael Aye  
>> wrote:
>>>
>>> On Oct 2, 2012, at 11:09 AM, Damon McDougall  
>>> wrote:
>>>
 On Tue, Oct 2, 2012 at 5:51 PM, K.-Michael Aye  
 wrote:
>
>
> On Oct 2, 2012, at 6:33 AM, Damon McDougall  
> wrote:
>
>> On Tue, Oct 2, 2012 at 2:19 PM, Benjamin Root  wrote:
>>>
>>>
>>> On Mon, Oct 1, 2012 at 7:20 PM, Michael Aye  
>>> wrote:

 Hi!

 I see that the function ax.imshow takes the parameter 'imlim' but in
 the source (status: EPD 7.3-2) it is not being used?
 So what is it for?

 Best regards,
 Michael


>>>
>>> Confirmed.  I don't see imlim anywhere except in the imshow() 
>>> signature.  I
>>> have no recollection of this parameter, so it might be from before my 
>>> time.
>>>
>>> Ben Root
>>
>> Is there some functionality you were looking for or were you just
>> exploring the codebase?
>>
> How nice of you to ask! ;)
> Indeed: I had the case that image arrays inside an ImageGrid where shown 
> with some white overhead area around, e.g. for an image of 100 pixels on 
> the x-axis, the imshow resulted in an x-axis that went from -10 to 110. I 
> was looking for a simple way to suppress that behavior and let imshow 
> instead use the exact image extent. I believe that the plot command has 
> such a flag, hasn't it? (I.e. to use the exact xdata range and not try to 
> beautify the plot?
>
> Michael
>
>
>> --
>> Damon McDougall
>> http://www.damon-is-a-geek.com
>> B2.39
>> Mathematics Institute
>> University of Warwick
>> Coventry
>> West Midlands
>> CV4 7AL
>> United Kingdom

 Is the 'extent' keyword what you're looking for?

>>>
>>> No, because it needs detail. I was looking for a boolean switch that 
>>> basically says: Respect the data, not beauty.
>>
>> I don't understand what you mean by 'beauty'. If your image is 100
>> pixels wide and 50 pixels tall, what is it about extent=[0,100,0,50]
>> that doesn't do what you want?
>>
> As I wrote, that's not what is happening. I get extent=[-10,110,0,50].
>
>
>> --
>> Damon McDougall
>> http://www.damon-is-a-geek.com
>> B2.39
>> Mathematics Institute
>> University of Warwick
>> Coventry
>> West Midlands
>> CV4 7AL
>> United Kingdom
>

The following script works for me:

import numpy as np
import matplotlib.pyplot as plt

image = np.random.random((100,50))

fig = plt.figure()
ax = fig.add_subplot(1, 1, 1)
ax.imshow(image, extent=[0,100,0,50])
plt.show()


-- 
Damon McDougall
http://www.damon-is-a-geek.com
B2.39
Mathematics Institute
University of Warwick
Coventry
West Midlands
CV4 7AL
United Kingdom

--
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] imlim in ax.imshow

2012-10-02 Thread K.-Michael Aye

On Oct 2, 2012, at 12:06 PM, Damon McDougall  wrote:

> On Tue, Oct 2, 2012 at 8:00 PM, K.-Michael Aye  wrote:
>> 
>> On Oct 2, 2012, at 11:09 AM, Damon McDougall  
>> wrote:
>> 
>>> On Tue, Oct 2, 2012 at 5:51 PM, K.-Michael Aye  
>>> wrote:
 
 
 On Oct 2, 2012, at 6:33 AM, Damon McDougall  
 wrote:
 
> On Tue, Oct 2, 2012 at 2:19 PM, Benjamin Root  wrote:
>> 
>> 
>> On Mon, Oct 1, 2012 at 7:20 PM, Michael Aye  
>> wrote:
>>> 
>>> Hi!
>>> 
>>> I see that the function ax.imshow takes the parameter 'imlim' but in
>>> the source (status: EPD 7.3-2) it is not being used?
>>> So what is it for?
>>> 
>>> Best regards,
>>> Michael
>>> 
>>> 
>> 
>> Confirmed.  I don't see imlim anywhere except in the imshow() signature. 
>>  I
>> have no recollection of this parameter, so it might be from before my 
>> time.
>> 
>> Ben Root
> 
> Is there some functionality you were looking for or were you just
> exploring the codebase?
> 
 How nice of you to ask! ;)
 Indeed: I had the case that image arrays inside an ImageGrid where shown 
 with some white overhead area around, e.g. for an image of 100 pixels on 
 the x-axis, the imshow resulted in an x-axis that went from -10 to 110. I 
 was looking for a simple way to suppress that behavior and let imshow 
 instead use the exact image extent. I believe that the plot command has 
 such a flag, hasn't it? (I.e. to use the exact xdata range and not try to 
 beautify the plot?
 
 Michael
 
 
> --
> Damon McDougall
> http://www.damon-is-a-geek.com
> B2.39
> Mathematics Institute
> University of Warwick
> Coventry
> West Midlands
> CV4 7AL
> United Kingdom
>>> 
>>> Is the 'extent' keyword what you're looking for?
>>> 
>> 
>> No, because it needs detail. I was looking for a boolean switch that 
>> basically says: Respect the data, not beauty.
> 
> I don't understand what you mean by 'beauty'. If your image is 100
> pixels wide and 50 pixels tall, what is it about extent=[0,100,0,50]
> that doesn't do what you want?
> 
As I wrote, that's not what is happening. I get extent=[-10,110,0,50].


> -- 
> Damon McDougall
> http://www.damon-is-a-geek.com
> B2.39
> Mathematics Institute
> University of Warwick
> Coventry
> West Midlands
> CV4 7AL
> United Kingdom


--
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] imlim in ax.imshow

2012-10-02 Thread Damon McDougall
On Tue, Oct 2, 2012 at 8:00 PM, K.-Michael Aye  wrote:
>
> On Oct 2, 2012, at 11:09 AM, Damon McDougall  
> wrote:
>
>> On Tue, Oct 2, 2012 at 5:51 PM, K.-Michael Aye  
>> wrote:
>>>
>>>
>>> On Oct 2, 2012, at 6:33 AM, Damon McDougall  
>>> wrote:
>>>
 On Tue, Oct 2, 2012 at 2:19 PM, Benjamin Root  wrote:
>
>
> On Mon, Oct 1, 2012 at 7:20 PM, Michael Aye  
> wrote:
>>
>> Hi!
>>
>> I see that the function ax.imshow takes the parameter 'imlim' but in
>> the source (status: EPD 7.3-2) it is not being used?
>> So what is it for?
>>
>> Best regards,
>> Michael
>>
>>
>
> Confirmed.  I don't see imlim anywhere except in the imshow() signature.  
> I
> have no recollection of this parameter, so it might be from before my 
> time.
>
> Ben Root

 Is there some functionality you were looking for or were you just
 exploring the codebase?

>>> How nice of you to ask! ;)
>>> Indeed: I had the case that image arrays inside an ImageGrid where shown 
>>> with some white overhead area around, e.g. for an image of 100 pixels on 
>>> the x-axis, the imshow resulted in an x-axis that went from -10 to 110. I 
>>> was looking for a simple way to suppress that behavior and let imshow 
>>> instead use the exact image extent. I believe that the plot command has 
>>> such a flag, hasn't it? (I.e. to use the exact xdata range and not try to 
>>> beautify the plot?
>>>
>>> Michael
>>>
>>>
 --
 Damon McDougall
 http://www.damon-is-a-geek.com
 B2.39
 Mathematics Institute
 University of Warwick
 Coventry
 West Midlands
 CV4 7AL
 United Kingdom
>>
>> Is the 'extent' keyword what you're looking for?
>>
>
> No, because it needs detail. I was looking for a boolean switch that 
> basically says: Respect the data, not beauty.

I don't understand what you mean by 'beauty'. If your image is 100
pixels wide and 50 pixels tall, what is it about extent=[0,100,0,50]
that doesn't do what you want?

-- 
Damon McDougall
http://www.damon-is-a-geek.com
B2.39
Mathematics Institute
University of Warwick
Coventry
West Midlands
CV4 7AL
United Kingdom

--
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] imlim in ax.imshow

2012-10-02 Thread K.-Michael Aye


On Oct 2, 2012, at 6:33 AM, Damon McDougall  wrote:

> On Tue, Oct 2, 2012 at 2:19 PM, Benjamin Root  wrote:
>> 
>> 
>> On Mon, Oct 1, 2012 at 7:20 PM, Michael Aye  wrote:
>>> 
>>> Hi!
>>> 
>>> I see that the function ax.imshow takes the parameter 'imlim' but in
>>> the source (status: EPD 7.3-2) it is not being used?
>>> So what is it for?
>>> 
>>> Best regards,
>>> Michael
>>> 
>>> 
>> 
>> Confirmed.  I don't see imlim anywhere except in the imshow() signature.  I
>> have no recollection of this parameter, so it might be from before my time.
>> 
>> Ben Root
> 
> Is there some functionality you were looking for or were you just
> exploring the codebase?
> 
How nice of you to ask! ;)
Indeed: I had the case that image arrays inside an ImageGrid where shown with 
some white overhead area around, e.g. for an image of 100 pixels on the x-axis, 
the imshow resulted in an x-axis that went from -10 to 110. I was looking for a 
simple way to suppress that behavior and let imshow instead use the exact image 
extent. I believe that the plot command has such a flag, hasn't it? (I.e. to 
use the exact xdata range and not try to beautify the plot?

Michael


> -- 
> Damon McDougall
> http://www.damon-is-a-geek.com
> B2.39
> Mathematics Institute
> University of Warwick
> Coventry
> West Midlands
> CV4 7AL
> United Kingdom

--
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] imlim in ax.imshow

2012-10-02 Thread Damon McDougall
On Tue, Oct 2, 2012 at 2:19 PM, Benjamin Root  wrote:
>
>
> On Mon, Oct 1, 2012 at 7:20 PM, Michael Aye  wrote:
>>
>> Hi!
>>
>> I see that the function ax.imshow takes the parameter 'imlim' but in
>> the source (status: EPD 7.3-2) it is not being used?
>> So what is it for?
>>
>> Best regards,
>> Michael
>>
>>
>
> Confirmed.  I don't see imlim anywhere except in the imshow() signature.  I
> have no recollection of this parameter, so it might be from before my time.
>
> Ben Root

Is there some functionality you were looking for or were you just
exploring the codebase?

-- 
Damon McDougall
http://www.damon-is-a-geek.com
B2.39
Mathematics Institute
University of Warwick
Coventry
West Midlands
CV4 7AL
United Kingdom

--
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] imlim in ax.imshow

2012-10-02 Thread Benjamin Root
On Mon, Oct 1, 2012 at 7:20 PM, Michael Aye  wrote:

> Hi!
>
> I see that the function ax.imshow takes the parameter 'imlim' but in
> the source (status: EPD 7.3-2) it is not being used?
> So what is it for?
>
> Best regards,
> Michael
>
>
>
Confirmed.  I don't see imlim anywhere except in the imshow() signature.  I
have no recollection of this parameter, so it might be from before my time.

Ben Root
--
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] imlim in ax.imshow

2012-10-01 Thread Michael Aye
Hi!

I see that the function ax.imshow takes the parameter 'imlim' but in 
the source (status: EPD 7.3-2) it is not being used?
So what is it for?

Best regards,
Michael




--
Got visibility?
Most devs has no idea what their production app looks like.
Find out how fast your code is with AppDynamics Lite.
http://ad.doubleclick.net/clk;262219671;13503038;y?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users