From: Rich D. <dr...@in...> - 2005-02-17 04:24:16
|
Hello, I'm trying to get a figimage to be scaled up dimensionally to occupy the entire plot window rather than scrunched up in the upper left. The docs cryptically suggest: " * origin is either 'upper' or 'lower', which indicates where the [0,0] index of the array is in the upper left or lower left corner of the axes. Defaults to the rc image.origin value This complements the axes image which will be resampled to fit the current axes. If you want a resampled image to fill the entire figure, you can define an Axes with size [0,1,0,1]." But that is too cryptic for my current knowledge state. The following creates a scrunched image: figure(1) d=rand(100, 100) figimage(d) show() But this, probably naive guess, errors out with a transformation-not-invertible message: figure(1) axes([0,1,0,1]) d=rand(100, 100) figimage(d) show() Suggestions appreciated. Thanks, Rich |
From: Perry G. <pe...@st...> - 2005-02-17 05:00:48
|
If you want an image to spatially scale with the plot window, use implot instead of figimage. Figimage does not resample images spatially but rather displays them pixel for pixel (that's what distinguishes the two functions) Perry Greenfield > -----Original Message----- > From: mat...@li... > [mailto:mat...@li...]On Behalf Of Rich > Drewes > Sent: Wednesday, February 16, 2005 11:24 PM > To: mat...@li... > Subject: [Matplotlib-users] figimage filling entire image > > > Hello, > > I'm trying to get a figimage to be scaled up dimensionally to occupy the > entire plot window rather than scrunched up in the upper left. The docs > cryptically suggest: > > " * origin is either 'upper' or 'lower', which indicates where the [0,0] > index of the array is in the upper left or lower left corner of > the axes. Defaults to the rc image.origin value > > This complements the axes image which will be resampled to fit the > current axes. If you want a resampled image to fill the entire > figure, you can define an Axes with size [0,1,0,1]." > > But that is too cryptic for my current knowledge state. The following > creates a scrunched image: > > figure(1) > d=rand(100, 100) > figimage(d) > show() > > But this, probably naive guess, errors out with a > transformation-not-invertible message: > > figure(1) > axes([0,1,0,1]) > d=rand(100, 100) > figimage(d) > show() > > Suggestions appreciated. Thanks, > > Rich > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
From: Rich D. <dr...@in...> - 2005-02-17 15:22:05
|
On Thu, 17 Feb 2005, Perry Greenfield wrote: > If you want an image to spatially scale with the plot window, use > implot instead of figimage. Figimage does not resample images spatially > but rather displays them pixel for pixel (that's what distinguishes > the two functions) Thanks for your response. I am familiar with implot however I've never been able to get it to plot with distinct pixel boundaries. What I want is a figimage-like plot with distinct, single-color regions, just larger regions, so that the entire screen window is filled. No smoothing or interpolation, just big chunky pixels. Can this be done? Rich |
From: John H. <jdh...@ac...> - 2005-02-18 15:15:51
|
>>>>> "Rich" == Rich Drewes <dr...@in...> writes: Rich> Thanks for your response. I am familiar with implot however Rich> I've never been able to get it to plot with distinct pixel Rich> boundaries. What I want is a figimage-like plot with Rich> distinct, single-color regions, just larger regions, so that Rich> the entire screen window is filled. No smoothing or Rich> interpolation, just big chunky pixels. Hi Rich, You'll probably want to use imshow(X, interpolation='nearest') to prevent smoothing / interpolation. Rich> "you can define an Axes with size [0,1,0,1]" Rich> The order of the points is wrong there, and you set me Rich> straight. OK, I'll fix that for the next release, thanks. See also the matshow command new to 0.72 which created an axes with the same aspect ration as your array. JDH |
From: Perry G. <pe...@st...> - 2005-02-17 15:43:15
|
On Feb 17, 2005, at 10:22 AM, Rich Drewes wrote: > On Thu, 17 Feb 2005, Perry Greenfield wrote: > >> If you want an image to spatially scale with the plot window, use >> implot instead of figimage. Figimage does not resample images >> spatially >> but rather displays them pixel for pixel (that's what distinguishes >> the two functions) > > Thanks for your response. I am familiar with implot however I've never > been able to get it to plot with distinct pixel boundaries. What I > want > is a figimage-like plot with distinct, single-color regions, just > larger > regions, so that the entire screen window is filled. No smoothing or > interpolation, just big chunky pixels. > > Can this be done? > > Rich Sure. To fill the entire window: axes((0,0,1,1)) # defines the axes bound to use the whole figure region (i.e, window) imshow(imdata, interpolation="nearest") # use nearest neighbor interpolation to rescale image Is this what you are looking for? Perry |
From: Rich D. <dr...@in...> - 2005-02-17 16:02:08
|
On Thu, 17 Feb 2005, Perry Greenfield wrote: > Sure. To fill the entire window: > > axes((0,0,1,1)) # defines the axes bound to use the whole figure region Yes! There is (I think) an error in the documentation, both HTML online (http://matplotlib.sourceforge.net/matplotlib.pylab.html#-figimage) and also the .pdf version, where it says this: "you can define an Axes with size [0,1,0,1]" The order of the points is wrong there, and you set me straight. Thanks much, Rich |