hvplot icon indicating copy to clipboard operation
hvplot copied to clipboard

Add support for plotting a slope on scatter points

Open maximlt opened this issue 1 year ago • 0 comments

HoloViews has the Slope element that displays a line with a gradient and a y-intercept. It also has a from_scatter class method that fits the line based on a Scatter element (using np.polyfit(x, y, 1, full=True)). This could be exposed in hvPlot with a slope parameter accepting:

  • True: gradient of 1 and intercept of 0
  • 'infer': use from_scatter
  • dict: custom gradient and intercept

Note that at the moment HoloViews Slope doesn't have a Plotly implementation, but this shouldn't be too hard to implement if required.

image

maximlt avatar Apr 11 '24 17:04 maximlt