On 10/27/11 1:41 AM, Yoshi Rokuko wrote:
> if one saves a Basemap plot with savefig option
> bbox_inches='tight' geographical coordinates
> are cut:
>
> bmap = Basemap(...)
> bmap.drawparallels([those,numbers,are,gone],
>                     labels=[1,0,0,0])
> bmap.drawmeridians([those,numbers,are,gone],
>                     labels=[0,0,0,1])
> plt.contourf(...)
> plt.savefig(file, bbox_inches='tight')
>
> is this missbehavior known, or is there a simple
> fix for that?
>
> best regards, yoshi
Yoshi:

You can use the pad_inches keyword to adjust the amount of space left 
around the map.

Try this:

from mpl_toolkits.basemap import Basemap
import numpy as np
import matplotlib.pyplot as plt
bmap = Basemap()
bmap.drawcoastlines()
bmap.drawparallels(np.arange(-90,91,30),
                            labels=[1,0,0,0])
bmap.drawmeridians(np.arange(0,360,60),
                            labels=[0,0,0,1])
plt.savefig('bboxtight.png', bbox_inches='tight',pad_inches=0.45)

-Jeff


------------------------------------------------------------------------------
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
Take a complimentary Learning@Cisco Self-Assessment and learn 
about Cisco certifications, training, and career opportunities. 
http://p.sf.net/sfu/cisco-dev2dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to