|
From: Michael A. <kmi...@gm...> - 2012-10-02 19:22:25
|
> >>>>>
> >>>> 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(10000).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
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
|