from IPython.display import HTML
HTML("""<script src='https://code.highcharts.com/highcharts.js'></script>
<div id='container' style='height:600px; width:600px; margin:0 auto'></div>
<script>
function getinteger(min,max) {return Math.floor(Math.random()*(max-min+1))+min;};
var a=getinteger(5,11),b=getinteger(12,24),c=getinteger(25,81),d=getinteger(216,256);
function f(t,i,n) {
return (a+0.9*Math.cos(0.01*b*t+Math.PI*i/n))*(1+0.1*Math.cos(0.01*c*t+Math.PI*i/n))*
(1+0.05*Math.cos(0.01*d*t+Math.PI*i/n))*(1+Math.sin(0.01*t+Math.PI*i/n));};
function ar(i,n) {
return Array(640).fill(i).map((r,t)=>[f(t,i,n)*Math.cos(0.01*t),f(t,i,n)*Math.sin(0.01*t)]);};
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=36;
for (i=1; i<2*n+1; i++) {series.push({name:i.toString(),color:col(i),lineWidth:.7,data:ar(i,n)})};
Highcharts.chart('container', {
chart:{type:'line',backgroundColor:'black'},xAxis:{title:{text:'x'}},yAxis:{title:{text:'y'}},
title:{text:'Random Parametric Plot',style:{color:'white'}},credits:{enabled:false},
legend:{enabled:false},series:series});
</script>""")
No comments:
Post a Comment