plotly / plotly/plotly.py

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

未關閉
#3,166 9 則留言 35 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

feature P3
主要語言
Python
星號
18.8k
分支
2.8k
平均合併
16 小時 26 分鐘
30 天內合併 PR
21

描述

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)

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

Issue 中沒有指定檔案或測試。首先檢查現有的 plotting API 以及用於新增線或軌跡的測試,然後將它們的行為與所要求的 R 風格簽名進行比較。當僅憑斜率/截距即可新增線,並提供水平線和垂直線選項,且不需要取樣的 x 值或手動查找座標軸範圍時,即視為完成。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
python
領域
data-visualization
Issue 類型
功能
難度
5/5
預估耗時
一週以上
活躍度
停滯
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。