matplotlib / matplotlib/basemap

basemap plot the opposite longitudinal section

未关闭
#359 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
Python
星标
817
派生
395
PR 合并指标
30 天内没有已合并 PR

描述

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

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

使用 Basemap 1.0.7 和 matplotlib 2.0.0,采用经度边界 [60,190] 和 bluemarble 背景,复现报告中的代码。首先检查跨越国际日期变更线时如何处理 Mercator 边界和 lon_0;当 Indo-Pacific 部分按要求的方向和范围显示时,即视为完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
python
领域
data-visualization
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
25/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。