Get your own website Result Size: 625 x 565
x
 
<!DOCTYPE html>
<html>
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
<body>
<div id="myPlot" style="width:100%;max-width:700px"></div>
<script>
var exp = "Math.sin(x)";
// Generate values
var xValues = [];
var yValues = [];
for (var x = 0; x <= 10; x += 0.1) {
  xValues.push(x);
  yValues.push(eval(exp));
}
// Display using Plotly
var data = [{x:xValues, y:yValues, mode:"lines"}];
var layout = {title: "y = " + exp};
Plotly.newPlot("myPlot", data, layout);
</script>
</body>
<!-- Mirrored from www.w3schools.com/js/tryit.asp?filename=tryai_plotly_function by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 21 Dec 2022 17:07:06 GMT -->
</html>