matplotlib / matplotlib/basemap

pcolormesh not plotting onto 'ortho' basemap

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

还没有人认领这个 Issue。

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

描述

Hi There,

So I'm really new at this and quite out of my depth.

I was wondering if you could tell me why the following code is just giving me a blank sphere and not one with my pcolormesh information on:


from mpl_toolkits.basemap import Basemap
from netCDF4 import Dataset
import matplotlib.pyplot as plt
import numpy as np

convrain_set = Dataset('proxconvrain30.nc')
lats = convrain_set.variables['latitude'][:]
lons = convrain_set.variables['longitude'][:]
convrain = convrain_set.variables['cvrain'][:]
convrain = np.squeeze(convrain)
convrain_mean = np.mean(convrain,0)

map = Basemap(projection='ortho',lat_0=45,lon_0=-100,resolution='l')

map.drawmeridians(np.arange(0,360,30))
map.drawparallels(np.arange(-90,90,30))

lon,lat = np.meshgrid(lons,lats)

map.pcolormesh(lon,lat,convrain_mean)

plt.show()


I imagine I've just missed something simple and a little silly...

(Sorry if I've pub this question in the wrong place... I figured the people here were the best placed to help...)

All the best,

Neil

贡献指南

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

从这里开始

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

调研方向

首先使用 Basemap、netCDF4、NumPy 和 Matplotlib 重现 issue 中的脚本,然后使用提供的 longitude、latitude 和 convrain_mean 数组以及 ortho 投影检查 Basemap 的 pcolormesh 调用。将绘制结果与经线和纬线进行比较;当降雨数据出现在地球仪上,而不是只显示一个空白球体时,即表示完成。

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

评估

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

把新 issue 发到你的邮箱

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