[q-lang-cvs] qcalc/examples plot.qcalc,NONE,1.1
Brought to you by:
agraef
From: Albert G. <ag...@us...> - 2007-12-04 21:11:07
|
Update of /cvsroot/q-lang/qcalc/examples In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv27682 Added Files: plot.qcalc Log Message: add gnuplot example --- NEW FILE: plot.qcalc --- // qcalc 1.0, created Tue Dec 4 22:08:20 2007 -*-Q-*- -*- coding: UTF-8 -*- // [((1,0),"= label \"<center><b>x</b></center>\""),((1,1),"= label \"<center><b>sin(x)</b></center>\""),((1,2),"= label \"<center><b>cos(x)</b></center>\""),((1,4),("= label \"<h1>Gnuplot Examples</h1> <p>This example shows how to render plots inside qcalc using gnuplot. Note that the plots are really active gnuplot instances, so gnuplot's \\\"mousing\\\" techniques work as usual. E.g., try rotating the 3D plot on the right by dragging the mouse in the cell.</p>\"",6,3)),((2,0),"-5"),((2,1),"= sin (2*A3)"),((2,2),"= cos (2*B3)"),((3,0),"-4"),((3,1),"= sin (2*A4)"),((3,2),"= cos (2*B4)"),((4,0),"-3"),((4,1),"= sin (2*A5)"),((4,2),"= cos (2*B5)"),((5,0),"-2"),((5,1),"= sin (2*A6)"),((5,2),"= cos (2*B6)"),((6,0),"-1"),((6,1),"= sin (2*A7)"),((6,2),"= cos (2*B7)"),((7,0),"0"),((7,1),"= sin (2*A8)"),((7,2),"= cos (2*B8)"),((8,0),"1"),((8,1),"= sin (2*A9)"),((8,2),"= cos (2*B9)"),((9,0),"2"),((9,1),"= sin (2*A10)"),((9,2),"= cos (2*B10)"),((10,0),"3"),((10,1),"= sin (2*A11)"),((10,2),"= cos (2*B11)"),((10,4),"X range:"),((10,5),"= spinbox (-100,100,1,-15)"),((10,6),"= spinbox (-100,100,1,15)"),((11,0),"4"),((11,1),"= sin (2*A12)"),((11,2),"= cos (2*B12)"),((11,4),"Y range:"),((11,5),"= spinbox (-100,100,1,-15)"),((11,6),"= spinbox (-100,100,1,15)"),((12,0),"5"),((12,1),"= sin (2*A13)"),((12,2),"= cos (2*B13)"),((12,4),"Samples/Iso:"),((12,5),"= spinbox (1,100,1,25)"),((12,6),"= spinbox (1,100,1,20)"),((14,0),("= gnuplot \"set yrange [-1.5:1.5]; plot '-' using 1:2 title 'sin(x)' smooth csplines, '-' using 1:3 title 'cos(x)' smooth csplines\" (A3:C13,A3:C13)",1,3)),((14,4),("= gnuplot (sprintf \"set samples %d; set isosamples %d; set xrange [%g:%g]; set yrange [%g:%g]; set zrange [-0.25:1]; set pm3d; splot sin(sqrt(x**2+y**2))/sqrt(x**2+y**2)\" (F13,G13,F11,G11,F12,G12)) ()",1,4)),((15,0),("= label \"<b>2D plot using data from the spreadsheet</b>\"",1,3)),((15,4),("= label \"<b>3D plot using gnuplot-generated data</b>\"",1,4))] // [(14,250)] // [(3,52)] // Start of script. Please do not remove this line. |