This example comes directly from https://plot.ly/javascript/line-and-scatter/, and includes all the HTML needed to render in a browser.
Last active
February 1, 2019 16:54
-
-
Save pbogden/2b8945eeebf48798c8ff6d0d7230710c to your computer and use it in GitHub Desktop.
plot.ly scatterplot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<head> | |
<!-- Plotly.js --> | |
<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> | |
<script> | |
var trace1 = { | |
x: [1, 2, 3, 4], | |
y: [10, 15, 13, 17], | |
mode: 'markers', | |
type: 'scatter' | |
}; | |
var trace2 = { | |
x: [2, 3, 4, 5], | |
y: [16, 5, 11, 9], | |
mode: 'lines', | |
type: 'scatter' | |
}; | |
var trace3 = { | |
x: [1, 2, 3, 4], | |
y: [12, 9, 15, 12], | |
mode: 'lines+markers', | |
type: 'scatter' | |
}; | |
var data = [trace1, trace2, trace3]; | |
Plotly.newPlot('myDiv', data); | |
</script> | |
</body> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment