Amen_90
Amen_90

Reputation: 350

hv.Slope.from_scatter, anyway to get the computed coefficient for this?

I'm plotting some scatter plots using holoviews and using hv.slope to compute the the slope for me. Code is as follows:

 Scatter_test = hv.Scatter(Scatter_Brand, vdims=['Brand'], kdims=['x', 'y'])
 Scatter_plot = Scatter_test  * hv.Slope.from_scatter(Scatter_test).opts(tools=['hover'])

However, does anyone know how I can get the computed coeffcient for the slope that holoviews computes and plots for me to appear on the slope that has been calculated? I've tried included the hover tool but no luck. Is it possible, or does anyone know of a work around?

Kind regards

Upvotes: 1

Views: 145

Answers (1)

Han-Teng Liao
Han-Teng Liao

Reputation: 1

Please try if following works:

slp = hv.Slope.from_scatter(Scatter_test)
print ( slp.slope, slp.y_intercept)

You might be able to expore the attributes and functions using:

slp?

Upvotes: 0

Related Questions