<div id='plotly1' style='width:600px; height:400px;'/>
doc1=document.getElementById('plotly1');
var x1=Array(80).fill(.05).map((r,t)=>r*(t-40));
var y1=Array(80).fill(.05).map((r,t)=>Math.exp(-Math.pow(r*(t-40),2)));
var y2=Array(80).fill(.05).map((r,t)=>-Math.exp(-Math.pow(r*(t-40),2)));
var y3=Array(80).fill(.05).map((r,t)=>
Math.sin(Math.PI*Math.pow(r*(t-40),3))*
Math.exp(-Math.pow(r*(t-40),2)));
Plotly.plot(doc1,[{x:x1,y:y1,line:{color:'#3636ff'},
marker:{symbol:317},mode:'markers',
hoverinfo:'y',name:'f(x) = e^{-x^2}'}]);
Plotly.plot(doc1,[{x:x1,y:y2,line:{color:'#36ff36'},
marker:{symbol:218},mode:'markers',
hoverinfo:'y',name:'f(x) = -e^{-x^2}'}]);
Plotly.plot(doc1,[{x:x1,y:y3,line:{color:'#ff3636'},
mode:'text',text:'☕',hoverinfo:'y',
name:'f(x) = sin(πx^3) e^{-x^2}'}]);
No comments:
Post a Comment