matplotlib / matplotlib/basemap

plotparallels()/plotmeridians() only support xoffset or yoffset not both and do not support horizontalalignment or verticalalignment

Ouverte
#325 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

plotparallels() and plotmeridians() only support xoffset or yoffset not both.

plotparallels() and plotmeridians() do not support horizontalalignment or verticalalignment via kwargs as these are hard coded within Basemap.

I found both of these because I wanted the labels inside the map border with the parallels above the line at the right of the plot and the meridians to the right of the line at the bottom of the plot. I found a hack by altering the returned matplotlib objects:

meridians = bmap.drawmeridians(meridians,labels=[0,0,1,0],fontsize=10,
                               color='gray', yoffset=-abs(right-left)
for k, v in meridians.iteritems():
    v[1][0].set_horizontalalignment('left')

This sets the label to the top but then moving them the size of the plot then setting horizontal alignment via returned matplotlib object.

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

Repérez les implémentations de plotparallels() et plotmeridians() et suivez la manière dont xoffset, yoffset et kwargs sont gérés. Vérifiez le comportement avec des labels des deux côtés de la carte : les deux offsets doivent fonctionner ensemble, et horizontalalignment et verticalalignment doivent être acceptés. C’est terminé lorsque les appelants n’ont plus besoin de modifier les objets matplotlib renvoyés pour ce positionnement.

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

Évaluation

Stack technique
python
Domaine
data-visualization
Type d'issue
Fonctionnalité
Difficulté
3/5
Temps estimé
1-2 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
45/100

Recevez les nouvelles issues par e-mail

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