<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 slope = 1.2;
var xValues = [];
var yValues = [];
// Generate values
for (var x = 0; x <= 10; x += 1) {
xValues.push(x);
yValues.push(x * slope);
}
// Define Data
var data = [{
x: xValues,
y: yValues,
mode: "lines"
}];
//Define Layout
var layout = {title: "Slope=" + slope};
// Display using Plotly
Plotly.newPlot("myPlot", data, layout);
</script>
</body>
<!-- Mirrored from www.w3schools.com/ai/tryit.asp?filename=tryai_plotly_function_linear2 by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 21 Dec 2022 16:51:32 GMT -->
</html>