In : import matplotlib
In : matplotlib.use('gtkagg')
In : import cartopy.crs as ccrs
In : import matplotlib.pyplot as plt
In : ax = plt.axes(projection=ccrs.Mercator())
In : ax.coastlines()
In : plt.show()
Here's sample output:
I have tried both the Mercator and Orthographic projections, the result is the same in both cases.
That's explainable... Cartopy maps automatically change their extent based on the data added (just like regular matplotlib axes)... but coastlines don't count (otherwise every time you added coastlines the map would switch to being global.)
Try adding ax.set_global()
Now it might be explainable... but is it reasonable or desirable?
That is reasonable; it is consistent with matplotlib.
Thanks for pointing it out.
My next trick is to automatically do global if no data has been added to the plot. I think this is perfectly achievable and would make a lot more sense than the current behaviour!
Automatically sets a plot to be global if no extents are set and no d…
…ata added. Fixes #72