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.

Valutazione

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

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.

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

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!

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

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.

Altre issue di matplotlib/basemap

Tutte le issue di matplotlib/basemap

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.