matplotlib / matplotlib/basemap

pcolormesh plot is blank; pcolor plot works

オープン
#170 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
Python
スター
817
フォーク
395
PR マージ指標
30日以内にマージされた PR はありません

説明

I am experiencing strange behavior using mpl_toolkits.basemap.Basemap.
My understanding is that pcolormesh is faster than pcolor, and thus
preferable. Here is a minimal example (below) where I get a different
plot from pcolormesh than from pcolor.

On two systems (mac os x 10.9.5; Ubuntu 11.04 (GNU/Linux 2.6.32.28
x86_64); basemap 1.0.7 on the mac and 1.0.8 on the Ubuntu machine; both
using matplotlib 1.4.2) I get the expected grid of random colors from
pcolor, but a monochrome plot from pcolormesh.

Is this expected? Are there circumstances in which I should be using
pcolor instead of pcolormesh? Is this a bug in matplotlib or in
basemap?

``` python
import matplotlib.pyplot as plt
from mpl_toolkits.basemap import Basemap
import numpy as np

def setup_map(ax):

m = Basemap(width=8.0e6,
height=6.5e6,
projection='aeqd',
lat_0=54,
lon_0=-105,
resolution='l',
area_thresh=1000,
rsphere=6371007.181000,
fix_aspect=True,
ax=ax)
m.drawcoastlines()
m.drawcountries()
m.drawstates()
return(m)

# create pseudo-data with longitudes and latitudes
lon, lat = np.meshgrid(np.arange(-180, 180),
np.arange(90, -90, -1))
data = np.random.rand(*lon.shape) * 100

# two-panel figure
fig, ax = plt.subplots(nrows=1, ncols=2)

# plot pseudodata in left panel using pcolormesh
m0 = setup_map(ax[0])
cm = m0.pcolormesh(lon, lat, data, latlon=True,
vmin=0.0, vmax=100.0, cmap=plt.cm.get_cmap("Blues"))
plt.colorbar(cm, ax=ax[0])
ax[0].set_title('pcolormesh')

# plot pseudodata in left panel using pcolor
m1 = setup_map(ax[1])
cm = m1.pcolor(lon, lat, data, latlon=True,
vmin=0.0, vmax=100.0, cmap=plt.cm.get_cmap("Blues"))
plt.colorbar(cm, ax=ax[1])
ax[1].set_title('pcolor')

plt.show()

```

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

Start with the supplied minimal Python example and compare Basemap.pcolormesh(..., latlon=True) with Basemap.pcolor(..., latlon=True) using the reported projection and data. Determine whether the blank or monochrome result is expected, and whether the needed change belongs in Basemap or matplotlib; done means the behavior is explained and a reproducible fix or clear upstream diagnosis is established.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
data-visualization
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。