I am using plotly js javascript library. But, in the case of single or two boxplots, the boxplots are taking too much space. Is there any way to set the width?
My code looks as:
var y0 = []; var y1 = []; for (var i = 0; i < 50; i ++) { y0[i] = Math.random(); y1[i] = Math.random() + 1; } let layout = { showlegend: false, newshape: { line: { width: 1 } }, /* boxgap: 0.9, */ yaxis: { tickprefix: "$" }, height: 450 } var trace1 = { y: y0, type: 'box' }; var data = [trace1]; Plotly.newPlot('myDiv', data, layout);
<head> <!-- Load plotly.js into the DOM --> <script src='https://cdn.plot.ly/plotly-latest.min.js'></script> </head> <body> <div id='myDiv'><!-- Plotly chart will be drawn inside this DIV --></div> </body>
2.1m questions
2.1m answers
60 comments
57.0k users