plotly / plotly/plotly.py

[Feature request] Make it easier to specify spacing in between titles and subtitles

Aperta
#5,434 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Lingua principale
Python
Stelle
18.8k
Fork
2.8k
Merge medio
16h 26m
PR unite (30g)
21

Descrizione

I really appreciate the subtitle parameter within Plotly Express charts. However, I'm finding that, when I use title_y to update the title's location, the subtitle's location doesn't follow accordingly. This can result in unsightly gaps between the title and subtitle.

Would it be possible to add a subtitle_y dimension that would let me adjust the spacing between title and subtitle elements? I suppose subtitle_x would be handy also in case some users want a horizontal offset between titles and subtitles.

Here are some screenshots for reference. First, in this chart, I'd like to move the title and subtitle up to increase the spacing between those elements and my legend:

Image

I can set title_y to 0.98 to move it farther from the legend; however, the y position of the subtitle moves up only a little, thus increasing the gap between the two.

Image

If there were a corresponding subtitle_y parameter that I could adjust, I would be able to easily resolve this issue. (In the meantime, I can get around it by creating subtitles via add_annotation.)

Thank you in advance for your consideration and help!

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia dal comportamento di Plotly Express per il posizionamento del sottotitolo e del titolo, in particolare dal modo in cui title_y influisce sul sottotitolo; confrontalo con l’attuale workaround basato su add_annotation. Il lavoro è completato quando gli utenti possono controllare indipendentemente gli offset verticale e orizzontale del sottotitolo senza lo spazio indesiderato e quando il comportamento è documentato e coperto da verifiche appropriate.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
python
Ambito
data-visualization
Tipo di issue
Funzionalità
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.