error plotting points that wrap around longitudinal map boundaries in plot() method of Basemap
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 45/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- matplotlib, python
調査の方向性
提供された Python スクリプトで失敗を再現し、次に報告された行の周辺にある mpl_toolkits/basemap/init.py の plot wrapper と shiftdata メソッドを調査してください。ソートされていない [-30, 10, -20] の点が、曖昧な配列エラーなしで順序を維持したままプロットされれば、修正は完了です。
索引モデルが issue の本文から書いたものです。
説明
Hi
Using Python 2.7.8 and Basemap 1.0.7 there seems to be a problem plotting points that wrap around longitudinal map boundaries in plot() method of Basemap if the points wrap back and forth. The problem can be avoided by sorting the points by longitude prior plotting (but this does of course not work if plotting a segment based on the points since sorting will screw up the order of the points along the segment)
The following code illustrates the problem by plotting the same three points sorted in different ways (first plot works)
#! /usr/bin/env python
import matplotlib
matplotlib.use('TkAgg')
import matplotlib.pyplot as plt
from mpl_toolkits.basemap import Basemap
bm = Basemap(llcrnrlon=0,llcrnrlat=-80,urcrnrlon=360,urcrnrlat=80,projection='mill')
fig=plt.figure(figsize=(8,4.5))
# figure with three points work
bm.plot([-30,-20,10], [10,10,10], "ro", latlon=True)
plt.show()
# figure with less than three points fail
bm.plot([-30,10,-20], [10,10,10], "ro", latlon=True)
plt.show()
and the error running the above code (after closing the first successful plot window) is
:~/SNSN/ALERT/seedlink> python TryBasemap.py
Traceback (most recent call last):
File "TryBasemap.py", line 16, in <module>
bm.plot([-30,10,-20], [10,10,10], latlon=True)
File "[...]/python2.7/site-packages/mpl_toolkits/basemap/__init__.py", line 536, in with_transform
x = self.shiftdata(x)
File "[...]/python2.7/site-packages/mpl_toolkits/basemap/__init__.py", line 4777, in shiftdata
if itemindex:
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
regP
- 主要言語
- Python
- スター
- 818
- フォーク
- 395
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
matplotlib/basemap のほかの issue
-
small bug in drawmapscale対応中かも @DavidVadnais が 35 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
matplotlib/basemap#368 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
matplotlib/basemap#655 ·
-
Python 3.14 wheelsオープン
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
matplotlib/basemap#652 · コメント 2 件 · リアクション 5 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 45/100
matplotlib/basemap#649 · リアクション 2 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
matplotlib/basemap#646 ·
matplotlib/basemap の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
modelcontextprotocol/python-sdk#3648 ·
メンテナーはふだん 1 日以内に返信
-
docs good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
VenetoStato/giorgio#6 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 70/100
EclipseFdn/open-vsx.org#13831 ·
メンテナーはふだん 1 日以内に返信