Implement the equivalent of abline (plot line using slope/intercept only) to add line to graph
还没有人认领这个 Issue。
- 主要语言
- 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)
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
Issue 中没有指定文件或测试。首先检查现有的 plotting API 以及用于添加线或轨迹的测试,然后将它们的行为与所请求的 R 风格签名进行比较。当仅凭斜率/截距即可添加线,并提供水平线和垂直线选项,且不需要采样的 x 值或手动查找坐标轴范围时,即视为完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- python
- 领域
- data-visualization
- Issue 类型
- 功能
- 难度
- 5/5
- 预计耗时
- 一周以上
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100