matplotlib / matplotlib/basemap
Contouring bug on lcc projection
还没有人认领这个 Issue。
- 主要语言
- Python
- 星标
- 817
- 派生
- 395
- PR 合并指标
- 30 天内没有已合并 PR
描述
This same issue is occurring for all data types. Quite often, though not always, one of any of the contoured data will spike sharply downward away from the rest of the contour (seen below in the yellow data). This happens quite often in the middle of the domain.
I doubt this is a problem with the data themselves or my analysis since this error makes the contour line cross other contour lines of the same data. If there were just an anomaly at the bottom of the domain, I would expect there to just be a gradient with the contouring toward it. This makes me think that the problem is all in the plotting.

Here's the plotting portion of my code.
`
#Plotting
fig = figure()
map = Basemap(llcrnrlon=-120.,llcrnrlat=20.,urcrnrlon=-50.,urcrnrlat=50.,\
rsphere=(6378137.00,6356752.3142),\
resolution='l',projection='lcc',\
lat_0=40.,lon_0=-98.,\
lat_1=30.,lat_2=60.)
#Draw geographical boundaries
map.drawcoastlines(color='red',linewidth=0.75)
map.drawstates(color='red',linewidth=0.75)
map.drawcountries(color='red',linewidth=0.75)
map.fillcontinents(color='black',lake_color='black')
map.drawmapboundary(fill_color='black')
#Create X-Y plane for contouring and filling on map
X,Y = map(asarray(longitude_grid), asarray(latitude_grid))
#1st Variable#
#------------#
levels = linspace(700., 1200., 126) #4 mb levels for SLP
cs = map.contour(X,Y,var,2,colors='c',linewidths=1.,levels=levels)
clabel(cs, fmt="%1.0f", fontsize=8, inline=1)
#2nd Variable#
#------------#
levels = linspace(0.,12000.,241) #50 m levels for thickness/height
cs = map.contour(X,Y,contr,2,colors='y',linewidths=0.75,levels=levels)
clabel(cs, fmt="%1.0f", fontsize=8, inline=1)
#Snow Contour#
#------------#
cs = map.contour(X,Y,snow,2,colors='w',linewidths=2.,levels=[0.,1.])
title('%s SLP [Blu] and 800-500 mb Height [Ylo] over Snow Line [Wht]' % times[i])
savefig('temp_plot%03d.jpg' % i)
`
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
未指定任何仓库文件或测试。首先使用相同的 longitude_grid、latitude_grid、var、contr 和 snow 输入,复现报告中展示的 Basemap lcc projection 和 contour 调用;完成的标准是确定 contour lines 出现意外尖峰或交叉的原因,并确认修正后的绘图行为不再显示这些 artifacts。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- matplotlib, python
- 领域
- data-visualization
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 需要澄清
- 新手友好度
- 25/100