error plotting points that wrap around longitudinal map boundaries in plot() method of Basemap
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 45/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- matplotlib, python
- Ambito
- data-visualization
Direzione di ricerca
Riproducete il problema con lo script Python fornito, quindi ispezionate mpl_toolkits/basemap/init.py nel plot wrapper e nel metodo shiftdata intorno alla riga segnalata. La correzione è completata quando i punti non ordinati [-30, 10, -20] vengono tracciati senza l'errore relativo a un array ambiguo, preservandone l'ordine.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- Python
- Stelle
- 818
- Fork
- 395
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di matplotlib/basemap
-
small bug in drawmapscaleForse già presa @DavidVadnais l’ha presa 36 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
matplotlib/basemap#368 ·
-
Add numpy 2.5 compatibilityAperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
matplotlib/basemap#655 ·
-
Python 3.14 wheelsAperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
matplotlib/basemap#652 · 2 commenti · 5 reazioni ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 45/100
matplotlib/basemap#649 · 2 reazioni ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
matplotlib/basemap#646 ·
Tutte le issue di matplotlib/basemap
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 3 giorni
-
Negation with "not" and "no" is ignored during sentiment analysisForse già presa @vivek-3728 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
techcsispit/mess-mood#11 · 1 commento ·
-
changelog investigate
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
ramnes/notion-sdk-py#408 ·
-
good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
btclib-org/btclib-wallet#267 ·
I maintainer di solito rispondono entro 1 giorno
-
good first issue tech-debt
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
knnmelprop/YAADO#111 ·