|
30 | 30 |
|
31 | 31 | * language |
32 | 32 |
|
33 | | -#+begin_src sh |
| 33 | +#+begin_src gnuplot |
34 | 34 | #!/usr/bin/gnuplot -persist |
| 35 | + a = 7 # variable assignent |
| 36 | + f(x,d) = d * x**2 # functions |
| 37 | + g(x) = x <= 0 ? sin(x) : NaN |
35 | 38 | #+end_src |
36 | 39 |
|
37 | | -- has variable assignment |
| 40 | +- NaN type |
38 | 41 | - "(/Symbol p)" - replaces parens with 𝛑 |
39 | 42 | - curve fitting https://www.youtube.com/watch?v=vHM_5AeKwXE |
40 | 43 | - do for [i=1:96] { plot f(x,i*0.1) } |
41 | | - |
| 44 | +- operators http://www.gnuplot.info/docs_4.2/node55.html |
| 45 | + |
| 46 | +** functions |
| 47 | +- http://www.gnuplot.info/docs/loc1283.html |
| 48 | +- math |
| 49 | +- string |
| 50 | +- time |
| 51 | +- other |
42 | 52 | ** input data |
43 | 53 |
|
44 | 54 | - space separated by default |
|
58 | 68 | *** plot |
59 | 69 |
|
60 | 70 | - [re]plot [PLOT_A OPTS], [PLOT_B OPTS] |
| 71 | + - for [n = 1 : 5] |
| 72 | + - widths = "30 15 5" |
| 73 | + for [width in widths] |
| 74 | + - "+" (previous filename) |
61 | 75 | - "filename.txt" |
62 | 76 | - /dev/stdin |
63 | 77 | - using N:N+1:N+n |
64 | 78 | - smooth [bezier¦mcsplines] |
65 | | - - title (for legend box) |
| 79 | + - title S (for legend box) |
66 | 80 | - index N |
67 | 81 | - reference block N of data (aka separated by 2 \n) |
68 | 82 | - blocks index start at 0 |
69 | 83 | - with |
| 84 | + - histograms |
| 85 | + - filledcurves |
| 86 | + - fillstyle pattern N |
70 | 87 | - linespoint |
71 | 88 | - lines |
72 | | - - linestyle N |
73 | | - - linecolor rgb "#0b0000" |
| 89 | + - [d]ash[t]ype N |
| 90 | + - [d]ash[t]ype S |
| 91 | + - [l]ine[s]tyle N |
| 92 | + - [l]ine[t]ype N |
| 93 | + - [l]ine[c]olor rgb "#0b0000" |
| 94 | + - [l]ine[c]olor rgb "green" |
| 95 | + - [l]ine[w]ith N |
74 | 96 | - points |
75 | 97 | - pointsize N |
76 | 98 | - imagesc - matrix/heatmap - 2d contour |
|
80 | 102 | ** options (setteable) |
81 | 103 |
|
82 | 104 | *** general |
83 | | -#+CAPTION: S = a quoted string, N = a number |
84 | | -|--------------+-------------------+------------------------------------| |
85 | | -| <c> | <c> | | |
86 | | -| | argument | description | |
87 | | -|--------------+-------------------+------------------------------------| |
88 | | -| border | [N] | axis lines (takes the bitsum) | |
89 | | -| [x¦y¦z]tics | [nomirror¦rotate] | axis numbers | |
90 | | -| | START,STEP,END | | |
91 | | -| | (S N[,S N]) | custom labels S at point N | |
92 | | -| [x¦y¦z]label | S | axis label | |
93 | | -| | offset N | | |
94 | | -| [x¦y¦z]range | [N:N] | axis range | |
95 | | -| grid | - | axis grid | |
96 | | -| key | [BLTR] [[no]box] | enable/disable/position legend box | |
97 | | -| | width N | | |
98 | | -| | font S | use ",14" to only change it's size | |
99 | | -| | at N,N | | |
100 | | -|--------------+-------------------+------------------------------------| |
101 | | -| samples | N | ???? | |
102 | | -| xdata | time | tells x axis is a date/time | |
103 | | -| encoding | utf8 | | |
104 | | -| timefmt | S | format of the INPUT date | |
105 | | -| datafile | separator S | input separator (default: space) | |
106 | | -|--------------+-------------------+------------------------------------| |
107 | | -| title | S | the | |
108 | | -| format | [x¦y] FMT | tic format string | |
109 | | -| scale | N | | |
110 | | -| logscale | [x¦y] [N] | with step N | |
111 | | -| autoscale | [[x¦y]fix] | prevents autoextend of scale | |
112 | | -| output | S | saves into filepath at S | |
113 | | -|--------------+-------------------+------------------------------------| |
114 | | -| pause | N | seconds to pause | |
115 | | -| +reread+ | - | REMOVED in 6.0 +reread input+ | |
116 | | -|--------------+-------------------+------------------------------------| |
| 105 | + |
| 106 | +#+CAPTION: S ="string", N=number, F=float |
| 107 | +|------------+------------+-----------------------------------| |
| 108 | +| <c> | <c> | | |
| 109 | +| table | "FILENAME" | save plot to file, unset it after | |
| 110 | +| encoding | utf8 | | |
| 111 | +|------------+------------+-----------------------------------| |
| 112 | +| title | S | the | |
| 113 | +| scale | N | | |
| 114 | +| output | S | saves into filepath at S | |
| 115 | +| monochrome | _ | | |
| 116 | +|------------+------------+-----------------------------------| |
| 117 | +| pause | N | seconds to pause | |
| 118 | +| +reread+ | - | REMOVED in 6.0 +reread input+ | |
| 119 | +|------------+------------+-----------------------------------| |
| 120 | + |
| 121 | +*** general: file parsing |
| 122 | + |
| 123 | +|-----------+-----------------+----------------------------------| |
| 124 | +| <c> | <c> | | |
| 125 | +|-----------+-----------------+----------------------------------| |
| 126 | +| datafile | separator S | | |
| 127 | +| | separator tab | | |
| 128 | +| | separator comma | input separator (default: space) | |
| 129 | +|-----------+-----------------+----------------------------------| |
| 130 | +| samples | N | sampling frequency | |
| 131 | +| [xyz]data | time | tells ? axis is a date/time | |
| 132 | +| timefmt | FMT | INPUT format date | |
| 133 | +| format | [x¦y] FMT | OUTPUT format string | |
| 134 | +|-----------+-----------------+----------------------------------| |
| 135 | + |
| 136 | +*** general: axis styling |
| 137 | + |
| 138 | +#+CAPTION: S ="string", N=number, F=float |
| 139 | +|---------------+----------------+----------------------------------| |
| 140 | +| <c> | <c> | | |
| 141 | +|---------------+----------------+----------------------------------| |
| 142 | +| border | [N] | pick axis lines (takes a bitsum) | |
| 143 | +| grid | - | axis grid | |
| 144 | +| logscale | [x¦y] [N] | with step N | |
| 145 | +| autoscale | [[x¦y]fix] | prevents autoextend of scale | |
| 146 | +| xdata | time | tells ? axis is a date/time | |
| 147 | +| format | [x¦y] FMT | OUTPUT format string | |
| 148 | +| [xyz][2]range | [N:N] | axis range | |
| 149 | +| [xyz][2]tics | nomirror | axis numbers | |
| 150 | +| | rotate | | |
| 151 | +| | START,STEP,END | | |
| 152 | +| | (S N[,S N]) | custom labels S at point N | |
| 153 | +| [xyz][2]label | S | axis label | |
| 154 | +| | offset N | | |
| 155 | +|---------------+----------------+----------------------------------| |
| 156 | +*** key |
| 157 | + |
| 158 | +|-----+---------------+-------------------------------| |
| 159 | +| | <c> | | |
| 160 | +| key | [BLTR] | position legend box | |
| 161 | +| | [no]box | enable/disable | |
| 162 | +| | at graph F, F | | |
| 163 | +| | width N | | |
| 164 | +| | font S | use ",14" to change size only | |
| 165 | +| | at N,N | | |
| 166 | +|-----+---------------+-------------------------------| |
| 167 | + |
117 | 168 | *** style |
118 | 169 |
|
119 | | -|------------------+---------------------------------| |
120 | | -| fill transparent | | |
121 | | -| solid F | | |
122 | | -| noborder | | |
123 | | -| data lines | | |
124 | | -| line N | can be later referenced on plot | |
125 | | -|------------------+---------------------------------| |
| 170 | +|-----------+-------------+----------------------------------| |
| 171 | +| <c> | <c> | | |
| 172 | +| fill | transparent | | |
| 173 | +| | solid | | |
| 174 | +| solid | F | | |
| 175 | +| noborder | _ | | |
| 176 | +| data | lines | sets default for *plot* with ... | |
| 177 | +| | histograms | | |
| 178 | +| line | N | can be later referenced on plot | |
| 179 | +| histogram | gap N | | |
| 180 | +| | cluster | | |
| 181 | +| | clustered | | |
| 182 | +| | rowstacked | | |
| 183 | +|-----------+-------------+----------------------------------| |
126 | 184 |
|
127 | 185 | #+CAPTION: gnuplot "test" command output |
128 | 186 | #+ATTR_HTML: :width 500 |
@@ -172,6 +230,7 @@ http://gnuplot.info/demo/pm3dcolors.html |
172 | 230 |
|
173 | 231 | * tools |
174 | 232 |
|
| 233 | +- emacs: [[https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-gnuplot.html][Org-babel-gnuplot]] |
175 | 234 | - wrapper: plot realtime and stored data from the cli https://github.com/dkogan/feedgnuplot |
176 | 235 | - config https://github.com/Gnuplotting/gnuplot-configs |
177 | 236 | - pallettes |
|
0 commit comments