<head>
		<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
</head>
<body>
  <div id="scatter3d" style="height:300px;width:300px;overflow:scroll;"> </div>
  <div id="scatter2d" style="height:300px;width:300px;overflow:scroll;"></div>
</body>

		
var trace3d = {
  x: [1, 2, 3, 4], 
  y: [5, 5, 2, 2],
  z: [3, 1, 2, 3], 
  mode: 'markers',
  type: 'scatter3d'
};
var data3d = [trace3d];
var layout3d = {};
Plotly.newPlot('scatter3d', data3d, layout3d);


var trace2d = {
  x: [1, 2, 3, 4, 5],
  y: [1, 6, 3, 6, 1],
  mode: 'markers',
  type: 'scatter',
};

var data2d = [ trace2d ];
var layout2d = {};
var conf2d = {
  scrollZoom: true
}
Plotly.newPlot('scatter2d', data2d, layout2d, conf2d);
Run Pen

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.