matplotlib / matplotlib/basemap

pcolormesh can't shiftdata when X,Y are 1 larger than data

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

还没有人认领这个 Issue。

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

描述

The pcolormesh docs (as noted in this issue https://github.com/matplotlib/basemap/issues/107) explain that:

"Ideally the dimensions of x and y should be one greater than those of data; if the dimensions are the same, then the last row and column of data will be ignored."

However when I actually try and use Basemap pcolormesh with this shape array, the shiftdata method sometimes fails because the data is not the same shape:

```
import numpy as np
from mpl_toolkits.basemap import Basemap
x = np.arange(-179, 191, 10)
y = np.array([50, 51, 52])
data = np.ones((2, 36))
xv, yv = np.meshgrid(x, y)
map = Basemap()
map.pcolormesh(xv, yv, data, latlon=True)
```

results in this error (in 1.0.7):

IndexError: Inconsistant shape between the condition and the input (got (3, 37) and (2, 36))

贡献指南

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

从这里开始

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

调研方向

首先运行报告中的示例,并跟踪 Basemap.pcolormesh 到 shiftdata,即 issue 中提到的入口点。比较坐标形状 (3, 37) 与数据形状 (2, 36);当这个文档中记录的 pcolormesh 形状不再引发报告的 IndexError 时,即表示完成。

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

评估

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

把新 issue 发到你的邮箱

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