Unsightly white space in contour plots

Hi all,

I'm trying to visualize some data using countourf in pyplot, and I am having
a bit of trouble. For some reason, the y axis does not scale properly, and
an ugly white bar appears where there are no pixels to plot (see
screenshot). Ideally, I would like the axes to scale so that there is no
white space. The script I am using is:

q=1.60219e-19
kGrid = linspace(0.01,25e7,100)
epsGrid = linspace(1e-10*q,0.13e-3*q,100)
X,Y = meshgrid(kGrid,epsGrid)
Z = abs(integrand(X,Y))
CS = plt.contourf(X,Y/q/1000,Z,100,cmap=cm.PRGn)

Here, "integrand" is just some function that generates z values. I imagine
that it is something with aspect ratios or scaling, but I haven't been able
to figure it out from reading posts, so I would greatly appreciate some
guidance!

Many thanks,
John

http://old.nabble.com/file/p30120592/Screen%2Bshot%2B2010-11-03%2Bat%2B2.56.03%2BAM.png

···

--
View this message in context: http://old.nabble.com/Unsightly-white-space-in-contour-plots-tp30120592p30120592.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

Hi all,

I'm trying to visualize some data using countourf in pyplot, and I am having
a bit of trouble. For some reason, the y axis does not scale properly, and
an ugly white bar appears where there are no pixels to plot (see
screenshot). Ideally, I would like the axes to scale so that there is no
white space. The script I am using is:

q=1.60219e-19
kGrid = linspace(0.01,25e7,100)
epsGrid = linspace(1e-10*q,0.13e-3*q,100)
X,Y = meshgrid(kGrid,epsGrid)
Z = abs(integrand(X,Y))
CS = plt.contourf(X,Y/q/1000,Z,100,cmap=cm.PRGn)

Try following this with

plt.axis('tight')

Eric

···

On 11/03/2010 09:01 AM, jgamble wrote:

Here, "integrand" is just some function that generates z values. I imagine
that it is something with aspect ratios or scaling, but I haven't been able
to figure it out from reading posts, so I would greatly appreciate some
guidance!

Many thanks,
John

http://old.nabble.com/file/p30120592/Screen%2Bshot%2B2010-11-03%2Bat%2B2.56.03%2BAM.png