`fig.subplots_adjust` does not behave as advertized

The basemap demo `cubed_sphere.py` contains the following line of code:

   fig.subplots_adjust(bottom=0, left=0, right=1, top=0, wspace=0, hspace=0)

From the documentation, it would appear that `wspace=0` should remove all

horizontal space between the subplots. But, this isn't what happens. (I
tried to insert an image, but this feature of Nabble appears to be broken).

···

--
View this message in context: http://old.nabble.com/`fig.subplots_adjust`-does-not-behave-as-advertized-tp26471386p26471386.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

Dr. Phillip M. Feldman wrote:

The basemap demo `cubed_sphere.py` contains the following line of code:

   fig.subplots_adjust(bottom=0, left=0, right=1, top=0, wspace=0, hspace=0)

>From the documentation, it would appear that `wspace=0` should remove all
horizontal space between the subplots. But, this isn't what happens. (I
tried to insert an image, but this feature of Nabble appears to be broken).
  

Phillip: Do you see any white space between the unfolded faces of the cube on the cubed_sphere plot? If not, then that command is working as expected.

-Jeff

Dr. Phillip M. Feldman wrote:

The basemap demo `cubed_sphere.py` contains the following line of code:

   fig.subplots_adjust(bottom=0, left=0, right=1, top=0, wspace=0,
hspace=0)

>From the documentation, it would appear that `wspace=0` should remove all
horizontal space between the subplots. But, this isn't what happens. (I
tried to insert an image, but this feature of Nabble appears to be
broken).
  

Phillip: Do you see any white space between the unfolded faces of the
cube on the cubed_sphere plot? If not, then that command is working as
expected.

-Jeff

Jeff: I am seeing fairly large horizontal white spaces between the unfolded
faces of the cube (see attached image). Curiously, there are no vertical
white spaces.

http://old.nabble.com/file/p26486476/cubed_sphere.jpeg

···

--
View this message in context: http://old.nabble.com/`fig.subplots_adjust`-does-not-behave-as-advertized-tp26471386p26486476.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

Dr. Phillip M. Feldman wrote:

The basemap demo `cubed_sphere.py` contains the following line of code:

   fig.subplots_adjust(bottom=0, left=0, right=1, top=0, wspace=0,
hspace=0)

>From the documentation, it would appear that `wspace=0` should remove all
horizontal space between the subplots. But, this isn't what happens. (I
tried to insert an image, but this feature of Nabble appears to be
broken).
  

Phillip: Do you see any white space between the unfolded faces of the
cube on the cubed_sphere plot? If not, then that command is working as
expected.

-Jeff

I have some further information: I just tried it again, and realized that if
I use the original figure size and don't maximize the figure window, there
are no white spaces. I don't see the white spaces unless I maximizing the
figure window. Maximizing the figure window should change the overall size
of the image, but everything should scale together, so this is definitely a
bug.

···

--
View this message in context: http://old.nabble.com/`fig.subplots_adjust`-does-not-behave-as-advertized-tp26471386p26486602.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

Jeff Whitaker wrote:

Dr. Phillip M. Feldman wrote:

The basemap demo `cubed_sphere.py` contains the following line of code:

   fig.subplots_adjust(bottom=0, left=0, right=1, top=0, wspace=0, hspace=0)

>From the documentation, it would appear that `wspace=0` should remove all
horizontal space between the subplots. But, this isn't what happens. (I
tried to insert an image, but this feature of Nabble appears to be broken).
  

Phillip: Do you see any white space between the unfolded faces of the cube on the cubed_sphere plot? If not, then that command is working as expected.

-Jeff

Jeff:

(I posted this same message via Nabble, but it doesn't seem to be getting through).

I have some further information: I just tried it again, and realized that if I use the original figure size and don't maximize the figure window, there are no white spaces. I don't see the white spaces unless I maximize the figure window. Maximizing the figure window should change the overall size of the image, but everything should scale together, so this is definitely a bug.

Phillip

Phillip M. Feldman wrote:

Jeff Whitaker wrote:

Dr. Phillip M. Feldman wrote:

The basemap demo `cubed_sphere.py` contains the following line of code:

   fig.subplots_adjust(bottom=0, left=0, right=1, top=0, wspace=0, hspace=0)

>From the documentation, it would appear that `wspace=0` should remove all
horizontal space between the subplots. But, this isn't what happens. (I
tried to insert an image, but this feature of Nabble appears to be broken).
  

Phillip: Do you see any white space between the unfolded faces of the cube on the cubed_sphere plot? If not, then that command is working as expected.

-Jeff

Jeff:

(I posted this same message via Nabble, but it doesn't seem to be getting through).

I have some further information: I just tried it again, and realized that if I use the original figure size and don't maximize the figure window, there are no white spaces. I don't see the white spaces unless I maximize the figure window. Maximizing the figure window should change the overall size of the image, but everything should scale together, so this is definitely a bug.

Phillip

Philip: It's not really a bug - but a "feature" of this particular example. For the white space to disappear, the figure must have exactly the same aspect ratio as the map projection. It's set that way in the example, but if you change but maximizing the window Basemap tries to maintain the aspect ratio of the map and leaves some whitespace. To get rid of the whitespace, at the expensive of messing up the aspect ratio of the map when you resize, set fix_aspect=True when initializing the basemap instance (for basemap >= 0.99.4).

-Jeff

···

--
Jeffrey S. Whitaker Phone : (303)497-6313
Meteorologist FAX : (303)497-6449
NOAA/OAR/PSD R/PSD1 Email : Jeffrey.S.Whitaker@...259...
325 Broadway Office : Skaggs Research Cntr 1D-113
Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg

Jeff Whitaker wrote:

Phillip M. Feldman wrote:

Jeff Whitaker wrote:

Dr. Phillip M. Feldman wrote:

The basemap demo `cubed_sphere.py` contains the following line of code:

   fig.subplots_adjust(bottom=0, left=0, right=1, top=0, wspace=0, hspace=0)

>From the documentation, it would appear that `wspace=0` should remove all
horizontal space between the subplots. But, this isn't what happens. (I
tried to insert an image, but this feature of Nabble appears to be broken).
  

Phillip: Do you see any white space between the unfolded faces of the cube on the cubed_sphere plot? If not, then that command is working as expected.

-Jeff

Jeff:

(I posted this same message via Nabble, but it doesn't seem to be getting through).

I have some further information: I just tried it again, and realized that if I use the original figure size and don't maximize the figure window, there are no white spaces. I don't see the white spaces unless I maximize the figure window. Maximizing the figure window should change the overall size of the image, but everything should scale together, so this is definitely a bug.

Phillip

Philip: It's not really a bug - but a "feature" of this particular example. For the white space to disappear, the figure must have exactly the same aspect ratio as the map projection. It's set that way in the example, but if you change but maximizing the window Basemap tries to maintain the aspect ratio of the map and leaves some whitespace. To get rid of the whitespace, at the expensive of messing up the aspect ratio of the map when you resize, set fix_aspect=True when initializing the basemap instance (for basemap >= 0.99.4).

-Jeff

Jeff: According to the documentation (in http://matplotlib.sourceforge.net/basemap/doc/html/api/basemap_api.html), fix_aspect=True is the default. (I verified that specifying fix_aspect=True does not change the behavior). So, I still think that there's a bug here. If I specify fix_aspect=False, then no white spaces appear when I maximize the figure, but the aspect ratio is messed up. It would be really great if there were some way to get a large plot without fouling up the aspect ratio. Yours, Phillip

Phillip M. Feldman wrote:

Jeff Whitaker wrote:

Phillip M. Feldman wrote:

Jeff Whitaker wrote:

Dr. Phillip M. Feldman wrote:

The basemap demo `cubed_sphere.py` contains the following line of code:

   fig.subplots_adjust(bottom=0, left=0, right=1, top=0, wspace=0, hspace=0)

>From the documentation, it would appear that `wspace=0` should remove all
horizontal space between the subplots. But, this isn't what happens. (I
tried to insert an image, but this feature of Nabble appears to be broken).
  

Phillip: Do you see any white space between the unfolded faces of the cube on the cubed_sphere plot? If not, then that command is working as expected.

-Jeff

Jeff:

(I posted this same message via Nabble, but it doesn't seem to be getting through).

I have some further information: I just tried it again, and realized that if I use the original figure size and don't maximize the figure window, there are no white spaces. I don't see the white spaces unless I maximize the figure window. Maximizing the figure window should change the overall size of the image, but everything should scale together, so this is definitely a bug.

Phillip

Philip: It's not really a bug - but a "feature" of this particular example. For the white space to disappear, the figure must have exactly the same aspect ratio as the map projection. It's set that way in the example, but if you change but maximizing the window Basemap tries to maintain the aspect ratio of the map and leaves some whitespace. To get rid of the whitespace, at the expensive of messing up the aspect ratio of the map when you resize, set fix_aspect=True when initializing the basemap instance (for basemap >= 0.99.4).

-Jeff

Jeff: According to the documentation (in http://matplotlib.sourceforge.net/basemap/doc/html/api/basemap_api.html), fix_aspect=True is the default. (I verified that specifying fix_aspect=True does not change the behavior). So, I still think that there's a bug here. If I specify fix_aspect=False, then no white spaces appear when I maximize the figure, but the aspect ratio is messed up. It would be really great if there were some way to get a large plot without fouling up the aspect ratio. Yours, Phillip

Philip: Sorry, I meant to say fix_aspec=False in my previous email. You can't preserve the aspect ratio of the map and not have white space appear when you resize the figure in that example. You can get a larger figure by modifying the figsize argument to plt.figure - just be sure to maintain the correct aspect ratio (10:7.5).

-Jeff

···

--
Jeffrey S. Whitaker Phone : (303)497-6313
Meteorologist FAX : (303)497-6449
NOAA/OAR/PSD R/PSD1 Email : Jeffrey.S.Whitaker@...259...
325 Broadway Office : Skaggs Research Cntr 1D-113
Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg