Plotting best fit line through medians of boxes


#1

HI,

I want to plot the best fit line through the medians. Is there a way to do it? Or get the medians somehow…


#2

We don’t expose a way to do that automatically in plotly.js. But you can always fit the data using another JS library and add the result to your graph using a separate trace.


#3

Is there a way to programmatically get the data?


#4

here’s how: https://codepen.io/etpinard/pen/gKmQYR?editors=0010


#5

how to do it in python?