function plotly(x,y) //if the file plotly.html already exists, delete it if getos() == 'Windows' then unix('del plotly.html'); else unix('rm -f plotly.html'); end header=''; container='
'; js=''; write('plotly.html', [header;container;js]) if getos() == 'Windows' then winopen('plotly.html') end endfunction x=[0:0.1:2*%pi]; y=sin(x); plotly(x,y)