basemap icon indicating copy to clipboard operation
basemap copied to clipboard

plotparallels()/plotmeridians() only support xoffset or yoffset not both and do not support horizontalalignment or verticalalignment

Open kylekeppler opened this issue 9 years ago • 0 comments

plotparallels() and plotmeridians() only support xoffset or yoffset not both.

plotparallels() and plotmeridians() do not support horizontalalignment or verticalalignment via kwargs as these are hard coded within Basemap.

I found both of these because I wanted the labels inside the map border with the parallels above the line at the right of the plot and the meridians to the right of the line at the bottom of the plot. I found a hack by altering the returned matplotlib objects:

meridians = bmap.drawmeridians(meridians,labels=[0,0,1,0],fontsize=10,
                               color='gray', yoffset=-abs(right-left)
for k, v in meridians.iteritems():
    v[1][0].set_horizontalalignment('left')

This sets the label to the top but then moving them the size of the plot then setting horizontal alignment via returned matplotlib object.

kylekeppler avatar Nov 02 '16 20:11 kylekeppler