matplotlib / matplotlib/basemap

Contouring bug on lcc projection

Ouverte
#377 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Langage dominant
Python
Étoiles
817
Forks
395
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

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.

![slp-007](https://user-images.githubusercontent.com/20845204/32189064-9fe770c6-bd77-11e7-9ab6-7fefa33ff6f9.jpg)

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)
`

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

Aucun fichier ni test du dépôt n’est indiqué. Commencez par reproduire la Basemap lcc projection et les appels à contour présentés dans le rapport avec les mêmes entrées longitude_grid, latitude_grid, var, contr et snow ; le travail sera terminé lorsque vous aurez déterminé pourquoi les lignes de contour présentent des pointes ou se croisent de manière inattendue et confirmé que le comportement de tracé corrigé n’affiche plus ces artefacts.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
matplotlib, python
Domaine
data-visualization
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
À clarifier
Accessibilité débutants
25/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.