diff --git a/guide/gnuplot-terminal-test.svg b/guide/gnuplot-terminal-test.svg new file mode 100644 index 0000000..61c72ab --- /dev/null +++ b/guide/gnuplot-terminal-test.svg @@ -0,0 +1,448 @@ + + + +Gnuplot +Produced by GNUPLOT 5.4 patchlevel 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + svg terminal test + + + gnuplot version 5.4.1 + + + + + + + 12345678901234567890 + + + 12345678901234567890 + + + true vs. estimated text dimensions + + + + + Enhanced text: x0n+1 + + + Enhanced text: Bold Italic + + + left justified + + + centre+d text + + + right justified + + + + + show ticscale + + + + + + + -1 + + + + + 0 + + + + + + + 1 + + + + + + 2 + + + + + + 3 + + + + + + 4 + + + + + + 5 + + + + + + 6 + + + + + + 7 + + + + + + 8 + + + + + + 9 + + + + + + 10 + + + + + + 11 + + + + + + 12 + + + + + + 13 + + + + + + 14 + + + + + + 15 + + + + + + 16 + + + + + + 17 + + + + + + 18 + + + + + + 19 + + + + + + 20 + + + + + + 21 + + + + + + 22 + + + + + + 23 + + + + + + + + + + + + rotated ce+ntred text + + + rotate by +45 + + + rotate by -45 + + + + + lw 1 + + + + + + + lw 2 + + + + + + + lw 3 + + + + + + + lw 4 + + + + + + + lw 5 + + + + + + + lw 6 + + + linewidth + + + + + + + dt 1 + + + + + dt 2 + + + + + dt 3 + + + + + dt 4 + + + + + dt 5 + + + dashtype + + + + + pattern fill + + + + + + + + + + 0 + + + + + + + + + + + 1 + + + + + + + + + + + 2 + + + + + + + + + + + 3 + + + + + + + + + + + 4 + + + + + + + + + + + 5 + + + + + + + + + + + 6 + + + + + + + + + + + 7 + + + + + + + + + + 8 + + + + + + + + + + + + + + + filled polygons: + + + + + diff --git a/guide/guide-10.svg b/guide/guide-10.svg index c310a93..ddf56ae 100644 --- a/guide/guide-10.svg +++ b/guide/guide-10.svg @@ -1,5 +1,6 @@ - -1 - - - - - - - - - - - - - -0.8 + 0 @@ -76,20 +64,7 @@ - -0.6 - - - - - - - - - - - - - -0.4 + 20 @@ -102,20 +77,7 @@ - -0.2 - - - - - - - - - - - - - 0 + 40 @@ -128,20 +90,7 @@ - 0.2 - - - - - - - - - - - - - 0.4 + 60 @@ -154,20 +103,7 @@ - 0.6 - - - - - - - - - - - - - 0.8 + 80 @@ -180,7 +116,7 @@ - 1 + 100 @@ -201,11 +137,24 @@ - + - + + 5 + + + + + + + + + + + + 10 @@ -214,11 +163,24 @@ - + - + + 15 + + + + + + + + + + + + 20 @@ -227,11 +189,24 @@ - + - + + 25 + + + + + + + + + + + + 30 @@ -240,11 +215,24 @@ - + - + + 35 + + + + + + + + + + + + 40 @@ -252,78 +240,13 @@ - - - - - - - 50 - - - - - - - - - - - - - 60 - - - - - - - - - - - - - 70 - - - - - - - - - - - - - 80 - - - - - - - - - - - - - 90 - - - - - - - 100 + 45 @@ -334,109 +257,38 @@ gnuplot_plot_1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + - + gnuplot_plot_2 + + + + + + @@ -580,57 +432,37 @@ - -1 + -600 - - -0.8 + + -400 - - -0.6 + + -200 - - -0.4 - - - - - -0.2 - - - - + 0 - - 0.2 + + 200 - - 0.4 + + 400 - - 0.6 - - - - - 0.8 - - - - - 1 + + 600 diff --git a/guide/guide-11.svg b/guide/guide-11.svg new file mode 100644 index 0000000..0523377 --- /dev/null +++ b/guide/guide-11.svg @@ -0,0 +1,419 @@ + + + +Gnuplot +Produced by GNUPLOT 5.4 patchlevel 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + + + + + + 200 + + + + + + + + + + + + + 400 + + + + + + + + + + + + + 600 + + + + + + + + + + + + + 800 + + + + + + + + + + + + + 1000 + + + + + + + + + + + + + 1200 + + + + + + + + + + + + + -10 + + + + + + + + + + + + + -5 + + + + + + + + + + + + + 0 + + + + + + + + + + + + + 5 + + + + + + + + + + + + + 10 + + + + + + + + + + + gnuplot_plot_1 + + + + + + + + + + + + + + + + + + + + + + + + + + gnuplot_plot_2 + + + + + + + + + + + + + + + + + + + + + + + + + + + gnuplot_plot_3 + + + + + + + + + + + + + + + + + + + + + + + + + + + gnuplot_plot_4 + + + + + + + + + gnuplot_plot_1 + + + using the 'x y xdelta ydelta' style + + + + + + + gnuplot_plot_2 + + + using the 'x y xlow xhigh ylow yhigh' style + + + + + + + gnuplot_plot_3 + + + using the 'x y ydelta' style + + + + + + + gnuplot_plot_4 + + + + + + + + + + + + + + + + diff --git a/guide/guide-12.svg b/guide/guide-12.svg index 9a08d4f..b8193d7 100644 --- a/guide/guide-12.svg +++ b/guide/guide-12.svg @@ -1,5 +1,6 @@ - + - + - - -1 + + -10 @@ -58,12 +59,12 @@ - + - - -0.8 + + -8 @@ -71,12 +72,12 @@ - + - - -0.6 + + -6 @@ -84,12 +85,12 @@ - + - - -0.4 + + -4 @@ -97,12 +98,12 @@ - + - - -0.2 + + -2 @@ -110,11 +111,11 @@ - + - + 0 @@ -123,12 +124,12 @@ - + - - 0.2 + + 2 @@ -136,12 +137,12 @@ - + - - 0.4 + + 4 @@ -149,12 +150,12 @@ - + - - 0.6 + + 6 @@ -162,12 +163,12 @@ - + - - 0.8 + + 8 @@ -175,12 +176,12 @@ - + - - 1 + + 10 @@ -188,12 +189,12 @@ - + - - -1 + + -10 @@ -201,12 +202,12 @@ - + - - -0.8 + + -8 @@ -214,12 +215,12 @@ - + - - -0.6 + + -6 @@ -227,12 +228,12 @@ - + - - -0.4 + + -4 @@ -240,12 +241,12 @@ - + - - -0.2 + + -2 @@ -253,11 +254,11 @@ - + - + 0 @@ -266,12 +267,12 @@ - + - - 0.2 + + 2 @@ -279,12 +280,12 @@ - + - - 0.4 + + 4 @@ -292,12 +293,12 @@ - + - - 0.6 + + 6 @@ -305,12 +306,12 @@ - + - - 0.8 + + 8 @@ -318,144 +319,61 @@ - + - - 1 + + 10 + + + + + 0 + + + + + 5 + + + + + 10 - + gnuplot_plot_1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + + + - + diff --git a/guide/guide.org b/guide/guide.org index 1ef651c..b6bccfe 100644 --- a/guide/guide.org +++ b/guide/guide.org @@ -247,3 +247,100 @@ gnuplot -e 'help linewidth' | head -n 20 `default` sets all line style parameters to those of the linetype with #+end_example + +gnuplot has a =test= command, which produces a demo of the various available +styles. This documentation uses the =svg= terminal (what gnuplot calls a +backend). So for the =svg= terminal, the various styles look like this: + +#+begin_src gnuplot :results file link :exports both :file gnuplot-terminal-test.svg +test +#+end_src + +#+RESULTS: +[[file:gnuplot-terminal-test.svg]] + +So for instance if you plot =--with 'linespoints pt 4 dt 2 lc 7'= you'll get a +red dashed line with square points. By default you'd be using one of the +interactive graphical terminals (=x11= or =qt=), which would have largely +similar styling. + +Let's make a plot with some variable colors and point sizes: + +#+BEGIN_SRC sh :results file link :exports both +seq -10 10 | \ +perl -nE '$, = " "; + say "parabola", $_*$_, abs($_)/2, $_*50; + say "line", $_*3. + 30.;' | \ +feedgnuplot --dataid \ + --tuplesize parabola 4 \ + --style parabola 'with points pointtype 7 pointsize variable palette' \ + --style line 'with lines lw 3 lc "red" dashtype 2' \ + --set 'cbrange [-600:600]' +#+END_SRC + +#+RESULTS: +[[file:guide-10.svg]] + +** Error bars +As before, the =gnuplot= documentation has the styling details: + +#+BEGIN_SRC sh :results none :exports code +gnuplot -e 'help xerrorbars' +gnuplot -e 'help yerrorbars' +gnuplot -e 'help xyerrorbars' +#+END_SRC + +For brevity, I'm not including the contents of those help pages here. These tell +us how to specify errorbars: how many columns to pass in, what they mean, etc. +Example: + +#+BEGIN_SRC sh :results file link :exports both +seq -10 10 | \ +perl -nE '$, = " "; + chomp; + $x = $_; + $y = $x*$x * 10 + 20; + say $x+1, "parabola", $y; + say $x+1, "parabola_symmetric_xyerrorbars", $y, $x*$x/80, $x*$x/4; + say $x, "parabola_unsymmetric_xyerrorbars", $y, $x-$x*$x/80, $x+$x*$x/40, $y-$x*$x/4, $y+$x*$x/8; + say $x, "line_unsymmetric_yerrorbars", $x*20+500, 40;' | \ +feedgnuplot --domain --dataid \ + --tuplesize parabola 2 \ + --style parabola "with lines" \ + --tuplesize parabola_symmetric_xyerrorbars 4 \ + --style parabola_symmetric_xyerrorbars "with xyerrorbars" \ + --legend parabola_symmetric_xyerrorbars "using the 'x y xdelta ydelta' style" \ + --tuplesize parabola_unsymmetric_xyerrorbars 6 \ + --style parabola_unsymmetric_xyerrorbars "with xyerrorbars" \ + --legend parabola_unsymmetric_xyerrorbars "using the 'x y xlow xhigh ylow yhigh' style" \ + --tuplesize line_unsymmetric_yerrorbars 3 \ + --style line_unsymmetric_yerrorbars "with yerrorbars" \ + --legend line_unsymmetric_yerrorbars "using the 'x y ydelta' style" \ + --xmin -10 --xmax 10 \ + --set 'key box opaque' +#+END_SRC + +#+RESULTS: +[[file:guide-11.svg]] + +** Polar coordinates +See + +#+BEGIN_SRC sh :results none :exports code +gnuplot -e 'help polar' +#+END_SRC + +Let's plot a simple =rho = theta= spiral: + +#+BEGIN_SRC sh :results file link :exports both +seq 100 | \ +perl -nE '$x = $_/10; \ + say "$x $x"' | \ +feedgnuplot --domain \ + --with 'lines' \ + --set 'polar' \ + --square +#+END_SRC + +#+RESULTS: +[[file:guide-12.svg]]