matplotlib / matplotlib/basemap

basemap plot the opposite longitudinal section

Abierto
#359 1 comentario 0 reacciones 0 asignados Ver en GitHub

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 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](https://github.com/matplotlib/basemap/issues/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

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Reproduce el código reportado con Basemap 1.0.7 y matplotlib 2.0.0, usando los límites de longitud [60,190] y el fondo bluemarble. Empieza comprobando cómo se gestionan los límites de Mercator y lon_0 al cruzar la línea internacional de cambio de fecha; se considera terminado cuando la sección del Indo-Pacífico se muestra con la orientación y el dominio solicitados.

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
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
25/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.