You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to plot a sector of the world in basemap using an orthographic projection and I would like to have a shadedrelief background.
If I don't use shadedrelief everything works fine:
import numpy as np
from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
fig = plt.figure()
ax = fig.add_subplot(111)
m = Basemap(projection='ortho',lon_0 = 0, lat_0 = 40,
llcrnrx=-3000000, llcrnry=1000000, urcrnrx=3000000, urcrnry=7000000,
resolution = 'l')
m.drawcoastlines()
m.fillcontinents(color='coral',lake_color='aqua')
# draw parallels and meridians.
m.drawparallels(np.arange(-90.,120.,30.))
m.drawmeridians(np.arange(0.,420.,60.))
m.drawmapboundary(fill_color='aqua')
However, when I add the command m.shadedrelief() (after removing the m.drawmapboundary and the m.fillcontinents commands) I get the following graph:
Apparently the problem is that the background is not restricted to the bounding box I set in the basemap command. I tried also with other backgrounds (e.g. bluemarble) but I get the same problem.
p.s. This is a copy of a thread that I opened on stackexchange, sorry for the cross-posting!
The text was updated successfully, but these errors were encountered:
I'm trying to plot a sector of the world in basemap using an orthographic projection and I would like to have a shadedrelief background.
If I don't use shadedrelief everything works fine:
However, when I add the command
m.shadedrelief()
(after removing them.drawmapboundary
and them.fillcontinents
commands) I get the following graph:Apparently the problem is that the background is not restricted to the bounding box I set in the basemap command. I tried also with other backgrounds (e.g. bluemarble) but I get the same problem.
p.s. This is a copy of a thread that I opened on stackexchange, sorry for the cross-posting!
The text was updated successfully, but these errors were encountered: