matplotlib / matplotlib/basemap
basemap plot the opposite longitudinal section
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 getting nothing from stackoverflow so I post it here.
The problem is I can't let bluemarble to plot a map showing the Indo-Pacific longitudinal section, covering the longitude band of about [60,190]. Below is my code:
import matplotlib.pyplot as plt
from mpl_toolkits.basemap import Basemap
lats=[-25,66]
lons=[60,187]
fig=plt.figure();ax=fig.add_subplot(111)
bmap=Basemap(projection='merc',\
llcrnrlat=lats[0],llcrnrlon=lons[0],\
urcrnrlat=lats[1],urcrnrlon=lons[1]-360.,\
lon_0=(lons[0]+lons[1])/2.,\
ax=ax)
bmap.bluemarble()
plt.show()
The result has its x-axis flipped, I guess somehow related to this issue#192
If I swap the llcrnrlon and urcrnrlon:
bmap=Basemap(projection='merc',\
llcrnrlat=lats[0],llcrnrlon=lons[1]-360.,\
urcrnrlat=lats[1],urcrnrlon=lons[0],\
lon_0=(lons[0]+lons[1])/2.,\
ax=ax)
the map shows correct orientation, but the wrong domain. I wanted to show the Indian ocean, Euro-asia and west Pacific, however the map shows the remaining longitudes, covering the central-east Pacific, America continents and Atlantic. The lon_0 argument doesn't seem to do anything.
I am aware that when crossing the dateline things get complicated and sometimes you need to shiftgrid() or shiftdata(), but in this case I have no data yet, just the bluemarble background.
Please help.
Some versions (all in conda with python2.7):
basemap=1.0.7=np111py27_0
matplotlib=2.0.0=np111py27_0
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Riproduci il codice segnalato con Basemap 1.0.7 e matplotlib 2.0.0, usando i limiti di longitudine [60,190] e lo sfondo bluemarble. Inizia verificando come vengono gestiti i limiti di Mercator e lon_0 quando si attraversa la linea internazionale del cambio di data; il lavoro è completato quando la sezione dell’Indo-Pacifico viene visualizzata con l’orientamento e il dominio richiesti.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python
- Ambito
- data-visualization
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 25/100