Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Increase Matplotlib Basemap Size?

How can I increase the size of the basemap? It is small compared to the size of the accompanying color bar. My basemap includes the geographic locations that I want, it is just physically too small. Thanks in advance for any guidance you can provide

like image 537
Apgar Ed Avatar asked Feb 19 '13 22:02

Apgar Ed


People also ask

What is Mpl_toolkits basemap?

Basemap is a matplotlib extension used to visualize and create geographical maps in python.

What can I use instead of basemap?

The Cartopy project will replace Basemap, but it hasn't yet implemented all of Basemap's features. All new software development should try to use Cartopy whenever possible, and existing software should start the process of switching over to use Cartopy.

Is basemap deprecated?

Basemap is deprecated in favor of the Cartopy project.


1 Answers

One possibilty is to call plt.figure(figsize=(WIDTH, HEIGHT)) before you call any of the drawing methods of your map object, like so:

from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt

plt.figure(figsize=(12,6))
map = Basemap()
map.drawcoastlines()
map.plot()
like image 140
ramiro Avatar answered Sep 20 '22 00:09

ramiro