Box plot from array with redundant keys

Dear all,
This is my first question, so bear with mistakes.
I am trying to plot arrays suppose y vs x.

var x= [“1”, “1”, “2”, “3”, “3”, “4”];
var y= [“100”, “150”, “300”, “400”, "50, “120”];

The plot looks similar to this if I plot simply:
newplot

But I want boxplot for each value of repeating x i.e. 100,150 for 1 as box and so on.
It may look like this
1
The power and exponential fit (plotly can not do this but external script is needed. Is it possible in javascript itself)?
Thanks in advance.

See https://codepen.io/etpinard/pen/Mvpwxj?editors=0010

Yes. For example: GitHub - Tom-Alexander/regression-js: Curve Fitting in JavaScript.

1 Like

Thanks @etienne ,
The box plots when put as two traces like simple scatter gave what I wanted for two series i.e. pink and cyan.
I could not get regression-js to run, working on it.

1 Like