|
From: Ryan M. <rm...@gm...> - 2010-03-28 19:04:31
|
On Sun, Mar 28, 2010 at 11:16 AM, Alan G Isaac <ala...@gm...> wrote: > Using contourf in version 0.99.1, > I'm seeing an unwanted white strip to > the top and right, adjacent to the axes. > (In fact, the strip looks just wide > enough to underlay the ticks.) > > Alan Isaac > > PS Simple example: > > x = np.linspace(-5, 5, 100) > X, Y = np.meshgrid(x, x) > Z = np.sin(x*y[:,None]) > fig = plt.figure() > ax = fig.add_subplot(1,1,1) > ax.contourf(Z) Well, in your simple example you're not even using the X and Y you calculate to give the spatial dimensions of your data, so it's just using indices, which run from 0 to 99. Since the limits are 0 to 100, bam...white space because, indeed, there is no data. If I do the following example, I don't get any whitespace: x = np.linspace(-5, 5, 100) X, Y = np.meshgrid(x, x) Z = np.sin(x*x[:,None]) #Note change from bug in previous ex. fig = plt.figure() ax = fig.add_subplot(1,1,1) ax.contourf(X, Y, Z) ax.set_xlim(-5, 5) ax.set_ylim(-5, 5) plt.draw() Is there something I'm missing? (Running SVN trunk here) Ryan -- Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma |