Debian Codegraph @

SciPlotDemo.html

raw
1 <html><head><title>SciPlot Widget Demo Programs</title></head><body>
2 <h1><a name="top">SciPlot Demo Programs</a></h1>
3
4 <ul>
5 <li><a href="#comp">Building</a>
6 <li><a href="#sciplot">xyplot — x/y plotter</a>
7 <ul>
8 <li><a href="#screen">Screen Shot</a>
9 <li><a href="#usage">Usage</a>
10 <li><a href="#data">Input File Format</a>
11 <li><a href="#sample">Sample Input File</a>
12 </ul>
13 <li><a href="#realtime">sciplot-realtime — Streaming real-time plotter</a>
14 </ul>
15
16 <ul>
17 <li><a href="SciPlot.html">SciPlot General Info</a>
18 <li><a href="SciPlotProg.html">Programmer's Documentation</a>
19 </ul>
20
21 <p><hr><h2><a name="comp">Building</a></h2>
22 <p>Two demo programs are shipped with the source distribution. Both require
23 GTK4, Cairo, and Pango (via <tt>pkg-config</tt>). Build with the standard
24 autotools sequence:
25
26 <p><code>autoreconf -fi &amp;&amp; ./configure &amp;&amp; make</code>
27
28 <p>The two programs produced are <tt>sciplot-xyplot</tt> and
29 <tt>sciplot-realtime</tt>.
30
31 <p><hr><h2><a name="sciplot">sciplot-xyplot — x/y plotter</a></h2>
32
33 <p>The <tt>sciplot-xyplot</tt> program takes a text file (or standard input)
34 as input and plots the data as x/y or polar plots. More than one set of data
35 may appear in a single plot frame, and more than one plot frame may be
36 displayed at once. As shown in the <a href="#screen">screen shot</a>, many
37 widget features are available as interactive controls before generating a
38 PostScript copy.
39
40 <h3><a name="screen">Screen Shot</a></h3>
41
42 <img src=SciPlotDemo.gif alt="[Picture of demo frame]">
43
44 <h3><a name="usage">Usage</a></h3>
45
46 <p><code>sciplot-xyplot [OPTION...] [FILE...]</code>
47
48 <p><tt>sciplot-xyplot</tt> accepts one or more input files on the command
49 line, or reads from standard input if none are given. Use
50 <tt>--help</tt> for a full option list and <tt>--version</tt> for version
51 information.
52
53 <h3><a name="data">Input File Format</a></h3>
54 <p>There are five commands recognised in the input file. Optional items are
55 enclosed in [square brackets].
56
57 <dl>
58 <dt><b>Title [title]</b>
59 <dd>Starts a new plot window, optionally setting the plot title.
60
61 <dt><b>Xaxis [label]</b>
62 <dd>Sets the x-axis label.
63
64 <dt><b>Yaxis [label]</b>
65 <dd>Sets the y-axis label.
66
67 <dt><b>Polar [rad]</b>
68 <dd>Switches the current plot to polar mode. Angles are in degrees by
69 default; add the keyword <tt>rad</tt> for radians.
70
71 <dt><b>Line legend-label</b>
72 <dd>Begins a new data series. Data lines follow immediately; the parser
73 continues reading pairs of numbers until it encounters another command or
74 end-of-file. Values are separated by commas, equals signs, or whitespace;
75 both coordinates must appear on the same line.
76 <p>The keyword <tt>skip</tt> may appear in place of a data line to break the
77 line into disjoint segments (see <tt>SCIPLOT_SKIP_VAL</tt>).
78 </dl>
79
80 <p>Text labels should be enclosed in double-quote characters.
81
82 <h3><a name="sample">Sample Input File</a></h3>
83 <pre>
84 Title="Crack Growth Comparison"
85 Xaxis="Number of Cycles (kc)"
86 Yaxis="Crack Depth (mm)"
87
88 Line="25% strain"
89 0.000000e+00 2.000000e+00
90 1.373497e+02 2.500000e+00
91 2.403780e+02 3.000000e+00
92 skip
93 3.205736e+02 3.500000e+00
94 3.845680e+02 4.000000e+00
95
96 Line="50% strain"
97 0.000000e+00 2.000000e+00
98 3.480081e+01 2.500000e+00
99 6.082956e+01 3.000000e+00
100 skip
101 8.105608e+01 3.500000e+00
102 9.719518e+01 4.000000e+00
103
104 Line="100% strain"
105 0.000000e+00 2.000000e+00
106 4.212263e+00 2.500000e+00
107 6.219232e+00 3.000000e+00
108 7.458972e+00 3.500000e+00
109 8.387889e+00 4.000000e+00
110 </pre>
111
112 <p><hr><h2><a name="realtime">sciplot-realtime — Streaming real-time plotter</a></h2>
113
114 <p><tt>sciplot-realtime</tt> reads whitespace- or comma-separated numeric
115 data from standard input and updates the plot as each line arrives.
116
117 <h3>Input format</h3>
118 <p>One sample per line. Lines beginning with <tt>#</tt> are ignored.
119
120 <table border>
121 <tr><th>Columns per line</th><th>Interpretation</th></tr>
122 <tr><td>1: <i>y</i></td>
123 <td>Single Y series; X auto-increments from 0</td></tr>
124 <tr><td>2: <i>x y</i></td>
125 <td>Explicit X and one Y series</td></tr>
126 <tr><td>N: <i>x y1 y2 …</i></td>
127 <td>Explicit X and N−1 Y series</td></tr>
128 </table>
129
130 <p>The number of series is fixed by the first data line.
131 When standard input reaches EOF the plot window stays open for
132 interactive use (axis toggles, PostScript export, etc.).
133
134 <h3>Options</h3>
135 <table border>
136 <tr><th>Option</th><th>Description</th></tr>
137 <tr><td><tt>-t, --title TEXT</tt></td><td>Plot title (default: "Real-time Data")</td></tr>
138 <tr><td><tt>-x, --xlabel TEXT</tt></td><td>X axis label</td></tr>
139 <tr><td><tt>-y, --ylabel TEXT</tt></td><td>Y axis label</td></tr>
140 <tr><td><tt>-l, --legend NAME,...</tt></td><td>Comma-separated series names</td></tr>
141 <tr><td><tt>-V, --version</tt></td><td>Show version and exit</td></tr>
142 <tr><td><tt>-h, --help</tt></td><td>Show help and exit</td></tr>
143 </table>
144
145 <h3>Usage</h3>
146
147 <p><code>sciplot-realtime [OPTION...]</code>
148
149 <p>Examples:
150
151 <pre>
152 # Plot a single sensor channel
153 sensor-tool | sciplot-realtime --ylabel "Temperature (C)"
154
155 # Plot multiple channels with named series
156 multi-sensor | sciplot-realtime --legend "ch1,ch2,ch3" --xlabel "Sample"
157
158 # Non-interactive preview of a data file
159 sciplot-realtime &lt; data.txt
160
161 # Plot ping round-trip times
162 ping host | awk '/time=/{gsub(/.*time=/,""); gsub(/ .*/,""); print}' \
163 | sciplot-realtime --ylabel "RTT (ms)"
164 </pre>
165
166 <hr>
167
168 <br> <a href=SciPlot.html>SciPlot</a> :
169 <a href=SciPlotProg.html>Programmer's Reference</a> |
170 <a href=SciPlotDemo.html>Demo Programs</a>
171 <br><hr>Originally by <a href="mailto:[email protected]">Rob McMullen</a>.
172 GTK4 port by <a href="mailto:[email protected]">Barak A. Pearlmutter</a>.
173 Updated: 2 Jun 2026<br></body></html>