"Example for 3D plot with Plotly in Calcpad
#hide
#rad
n = 100
A = matrix(n; n)
$Repeat{$Repeat{A.(i; j) = cos(π*(2*i/n - 1))^2 - sin(π*(3*j/n - 1)) + i/n + j/n @ j = 1 : n} @ i = 1 : n}
PlotWidth = 400','PlotHeight = 400
$Map{spline(i; j; A) @ i = 1 : n - 1 & j = 1 : n - 1}
#show
#val
'<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.17/d3.min.js"></script>
'<script src="https://cdn.plot.ly/plotly-2.26.0.min.js" charset="utf-8"></script>
'<div id="plotly"></div>
'<script>
'var z_data='A';
'var data = [{
'  z: z_data,
'  type: "surface",
'  colorscale: "YlGnBu",
'  contours: {
'    z: {
'      show:true,
'      usecolormap:true,
'      highlightcolor:"red",
'      project:{z: true}
'    }
'  }
'}];
'
'var layout = {
'  title: {
'    text: "Plotly"
'  },
'  scene: {camera: {eye: {x: -0.8, y: -0.9, z: 0.7}}, aspectmode: "manual", aspectratio: { x: 1, y: 1, z: 0.5}},
'  zaxis: {nticks:10},
'  autosize: false,
'  width: 800,
'  height: 600,
'  margin: {
'    l: 50,
'    r: 50,
'    b: 50,
'    t: 50,
'  }
'};
'Plotly.newPlot("plotly", data, layout);
'</script>