matplotlib / matplotlib/basemap

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

Aperta
#429 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Lingua principale
Python
Stelle
817
Fork
395
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia eseguendo l’esempio ortografico di Basemap dell’issue, prima senza immagini e poi con m.shadedrelief(); confronta l’estensione renderizzata con i limiti llcrnrx, llcrnry, urcrnrx e urcrnry. Controlla gli entry point shadedrelief e bluemarble e verifica che lo sfondo venga ritagliato alla regione della mappa richiesta, preservando il comportamento di proiezione esistente.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
python
Ambito
data-visualization
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.