matplotlib / matplotlib/basemap
Problem using Ortho projection and shadedrelief on a sector of the globe
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Python
- Estrellas
- 817
- Forks
- 395
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
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')
```
[![Orthographic projection without shadedrelief background][1]][1]
However, when I add the command `m.shadedrelief()` (after removing the `m.drawmapboundary` and the `m.fillcontinents` commands) I get the following graph:
[![Orthographic projection with shadedrelief background][2]][2]
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](https://gis.stackexchange.com/questions/298680/setup-shadedrelief-background-in-basemap-using-a-cropped-orthographic-projection), sorry for the cross-posting!
[1]: https://i.stack.imgur.com/iON27.png
[2]: https://i.stack.imgur.com/oVMAI.png
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comienza ejecutando el ejemplo ortográfico de Basemap del issue, primero sin imágenes y después con m.shadedrelief(); compara la extensión renderizada con los límites llcrnrx, llcrnry, urcrnrx y urcrnry. Comprueba los puntos de entrada shadedrelief y bluemarble y verifica que el fondo se recorte a la región del mapa solicitada, preservando el comportamiento de proyección existente.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- python
- Área
- data-visualization
- Tipo de issue
- Error
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 45/100