plotly / plotly/plotly.py

Implement the equivalent of abline (plot line using slope/intercept only) to add line to graph

Aperta
#3,166 9 commenti 35 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

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

Descrizione

Currently there seems to be no way to add a line to an existing graph (e.g. as a new trace) based on slope and intercept and without the necessity to find out the actual ranges of x and y axes of the figure.
All examples I have seen so far are based on using existing x values of dots in a scatter plot, calculating the corresponding y values for the line and adding those line segments in a new scatter plot trace.

But this has two huge disadvantages:

  • the y values have to get calculated for those x values (which may be a lot) or x values need to get selected
  • if a lot of segmets are calculated, the graph complexity increases a lot as well

But plotting a line based on just slope and intercept is probably the second most easy thing to do, so there should be a way to add a line that way.

The basic signature of the corresponding method or class could be similar to the corresponding R function:
ABline(a=intercept, b=slope, h=yforhorizontallines, v=xforverticallines)

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

Nell’issue non sono indicati file o test. Inizia esaminando l’API di plotting esistente e i test per l’aggiunta di linee o tracce, quindi confronta il loro comportamento con la firma in stile R richiesta. Il lavoro è completato quando è possibile aggiungere una linea usando solo pendenza/intercetta, con opzioni per linee orizzontali e verticali, senza richiedere valori x campionati né una ricerca manuale dell’intervallo degli assi.

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

Valutazione

Stack tecnologico
python
Ambito
data-visualization
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
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.