from IPython.display import HTML
HTML("""<script src='https://code.highcharts.com/highcharts.js'></script>
<div id='container4' style='height:600px; width:600px; margin:0 auto'></div>
<script>
function getinteger(min,max) {return Math.floor(Math.random()*(max-min+1))+min;};
function ar(k,a,b) {return Array(6400).fill(k).map((k,t)=>
[k*(Math.cos(0.001*t)+Math.cos(a*0.001*t)/2+Math.sin((a+b)*0.001*t)/3),
k*(Math.sin(0.001*t)+Math.sin(a*0.001*t)/2+Math.cos((a+b)*0.001*t)/3)]);};
function col(i) {var r=getinteger(i,255),g=getinteger(i,255),b=getinteger(i,255);
return 'rgb('+r.toString()+','+g.toString()+','+b.toString()+')';};
var series=[]; var i; var n=4;
for (i=1; i<n+1; i++) {
var a=getinteger(5,15),b=getinteger(10,24);
series.push({name:[i,a,b].toString(),color:col(i),lineWidth:0.7,data:ar(i,a,b)})};
Highcharts.chart('container4', {
chart:{type:'line',backgroundColor:'ghostwhite'},
xAxis:{title:{text:'x'}},yAxis:{title:{text:'y'}},
title:{text:'Random Parametric Plot'},credits:{enabled:false},
legend:{enabled:false},series:series});
</script>""")
No comments:
Post a Comment