matplotlib / matplotlib/basemap
pcolormesh not plotting onto 'ortho' basemap
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Python
- Sterne
- 817
- Forks
- 395
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
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
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne damit, das Skript aus dem Issue mit Basemap, netCDF4, NumPy und Matplotlib zu reproduzieren. Untersuche anschließend den Basemap-Aufruf `pcolormesh` mit den bereitgestellten longitude-, latitude- und `convrain_mean`-Arrays und der `ortho`-Projektion. Vergleiche das geplottete Ergebnis mit den Meridianen und Parallelen; abgeschlossen ist die Aufgabe, wenn die Niederschlagsdaten auf dem Globus erscheinen, statt nur eine leere Kugel anzuzeigen.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- Bereich
- data-visualization
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 20/100