matplotlib / matplotlib/basemap

Problem using Ortho projection and shadedrelief on a sector of the globe

Ouverte
#429 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Langage dominant
Python
Étoiles
817
Forks
395
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

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

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

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!

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

Commencez par exécuter l’exemple orthographique de Basemap de l’issue, d’abord sans imagerie, puis avec m.shadedrelief(); comparez l’étendue rendue aux limites llcrnrx, llcrnry, urcrnrx et urcrnry. Vérifiez les points d’entrée shadedrelief et bluemarble et assurez-vous que l’arrière-plan est rogné à la région cartographique demandée tout en préservant le comportement de projection existant.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
python
Domaine
data-visualization
Type d'issue
Bug
Difficulté
3/5
Temps estimé
1-2 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
45/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.