plotly / plotly/plotly.py

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

Offen
#3,166 9 Kommentare 35 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

feature P3
Vorherrschende Sprache
Python
Sterne
18.8k
Forks
2.8k
Ø Merge
16 Std. 26 Min.
Gemergte PRs (30 T.)
21

Beschreibung

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)

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Im Issue werden keine Dateien oder Tests genannt. Beginne damit, die bestehende Plotting-API und die Tests zum Hinzufügen von Linien oder Traces zu überprüfen, und vergleiche anschließend ihr Verhalten mit der angeforderten R-style-Signatur. Erledigt ist die Aufgabe, wenn eine Linie allein aus Steigung/Achsenabschnitt hinzugefügt werden kann, mit Optionen für horizontale und vertikale Linien, ohne abgetastete x-Werte oder eine manuelle Suche nach dem Achsenbereich zu erfordern.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
data-visualization
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.