Blob


1 <head>
2 <title>gview(1) - Plan 9 from User Space</title>
3 <meta content="text/html; charset=utf-8" http-equiv=Content-Type>
4 </head>
5 <body bgcolor=#ffffff>
6 <table border=0 cellpadding=0 cellspacing=0 width=100%>
7 <tr height=10><td>
8 <tr><td width=20><td>
9 <tr><td width=20><td><b>GVIEW(1)</b><td align=right><b>GVIEW(1)</b>
10 <tr><td width=20><td colspan=2>
11 <br>
12 <p><font size=+1><b>NAME </b></font><br>
14 <table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>
16 gview &ndash; interactive graph viewer<br>
18 </table>
19 <p><font size=+1><b>SYNOPSIS </b></font><br>
21 <table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>
23 <tt><font size=+1>gview</font></tt> [ <tt><font size=+1>&#8722;l</font></tt> <i>logfile</i> ] [ <tt><font size=+1>&#8722;m</font></tt> ] [ <i>file</i> ]<br>
25 </table>
26 <p><font size=+1><b>DESCRIPTION </b></font><br>
28 <table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>
30 <i>Gview</i> reads polygonal lines or a polygonal line drawing from an
31 <tt><font size=+1>ASCII</font></tt> input file (which defaults to standard input), and views
32 it interactively, with commands to zoom in and out, perform simple
33 editing operations, and display information about points and polylines.
34 The editing commands can change the color and
35 thickness of the polylines, delete (or undelete) some of them,
36 and optionally rotate and move them. It is also possible to generate
37 an output file that reflects these changes and is in the same
38 format as the input.
39 <table border=0 cellpadding=0 cellspacing=0><tr height=5><td></table>
41 Since the <tt><font size=+1>move</font></tt> and <tt><font size=+1>rotate</font></tt> commands are undesirable when just viewing
42 a graph, they are only enabled if <i>gview</i> is invoked with the <tt><font size=+1>&#8722;m</font></tt>
43 option.
44 <table border=0 cellpadding=0 cellspacing=0><tr height=5><td></table>
46 Clicking on a polyline with button 1 displays the coordinates
47 and a <i>t</i> value that tells how far along the polyline. <i>(t</i>=0 at the
48 first vertex, <i>t</i>=1 at the first vertex, <i>t</i>=1.5 halfway between the
49 second and third vertices, etc.) The <tt><font size=+1>&#8722;l</font></tt> option generates a log
50 file that lists all points selected in this manner.
51 <table border=0 cellpadding=0 cellspacing=0><tr height=5><td></table>
53 The most important interactive operations are to <i>zoom in</i> by sweeping
54 out a rectangle, or to <i>zoom out</i> so that everything currently being
55 displayed shrinks to fit in the swept-out rectangle. Other options
56 on the button 3 menu are <i>unzoom</i> which restores the coordinate
57 system to the default state where everything fits on
58 the screen, <i>recenter</i> which takes a point and makes it the center
59 of the window, and <i>square up</i> which makes the horizontal and vertical
60 scale factors equal.
61 <table border=0 cellpadding=0 cellspacing=0><tr height=5><td></table>
63 To take a graph of a function where some part is almost linear
64 and see how it deviates from a straight line, select two points
65 on this part of the graph (i.e., select one with button 1 and
66 then select the other) and then use the <i>slant</i> command on the button
67 3 menu. This slants the coordinate system so that the line
68 between the two selected points appears horizontal (but vertical
69 still means positive <i>y</i>). Then the <i>zoom in</i> command can be used
70 to accentuate deviations from horizontal. There is also an <i>unslant</i>
71 command that undoes all of this and goes back to an unslanted
72 coordinate system.
73 <table border=0 cellpadding=0 cellspacing=0><tr height=5><td></table>
75 There is a <i>recolor</i> command on button 3 that lets you select a
76 color and change everything to have that color, and a similar
77 command on button 2 that only affects the selected polyline. The
78 <i>thick</i> or <i>thin</i> command on button 2 changes the thickness of the
79 selected polyline and there is also an undo command for such
80 edits.
81 <table border=0 cellpadding=0 cellspacing=0><tr height=5><td></table>
83 Finally, button 3 had commands to <i>read</i> a new input file and display
84 it on top of everything else, <i>restack</i> the drawing order (in case
85 lines of different color are drawn on top of each other), <i>write</i>
86 everything into an output file, or <i>exit</i> the program.
87 <table border=0 cellpadding=0 cellspacing=0><tr height=5><td></table>
89 Each polyline in an input or output file is a space-delimited
90 <i>x y</i> coordinate pair on a line by itself, and the polyline is a
91 sequence of such vertices followed by a label. The label could
92 be just a blank line or it could be a string in double quotes,
93 or virtually any text that does not contain spaces and is on a
94 line by itself. The
95 label at the end of the last polyline is optional. It is not legal
96 to have two consecutive labels, since that would denote a zero-vertex
97 polyline and each polyline must have at least one vertex. (One-vertex
98 polylines are useful for scatter plots.)<br>
99 If the label after a polyline can contains the word <tt><font size=+1>Thick</font></tt> or a
100 color name <tt><font size=+1>(Red</font></tt>, <tt><font size=+1>Pink</font></tt>, <tt><font size=+1>Dkred</font></tt>, <tt><font size=+1>Orange</font></tt>, <tt><font size=+1>Yellow</font></tt>, <tt><font size=+1>Dkyellow</font></tt>, <tt><font size=+1>Green</font></tt>,
101 <tt><font size=+1>Dkgreen</font></tt>, <tt><font size=+1>Cyan</font></tt>, <tt><font size=+1>Blue</font></tt>, <tt><font size=+1>Ltblue</font></tt>, <tt><font size=+1>Magenta</font></tt>, <tt><font size=+1>Violet</font></tt>, <tt><font size=+1>Gray</font></tt>, <tt><font size=+1>Black</font></tt>, <tt><font size=+1>White</font></tt>),
102 whichever color name comes first will be used to color the polyline.
104 </table>
105 <p><font size=+1><b>EXAMPLE </b></font><br>
107 <table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>
109 To see a graph of the function <i>y</i>=<i>sin(</i>x<i>)/</i>x generate input with
110 an awk script and pipe it into <i>gview</i>:<br>
112 <table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>
114 <tt><font size=+1>awk 'BEGIN{for(x=.1;x&lt;500;x+=.1)print x,sin(x)/x}' | gview<br>
115 </font></tt>
116 </table>
118 </table>
119 <p><font size=+1><b>SOURCE </b></font><br>
121 <table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>
123 <tt><font size=+1>/usr/local/plan9/src/cmd/draw/gview.c<br>
124 </font></tt>
125 </table>
126 <p><font size=+1><b>SEE ALSO </b></font><br>
128 <table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>
130 <a href="../man1/awk.html"><i>awk</i>(1)</a><br>
132 </table>
133 <p><font size=+1><b>BUGS </b></font><br>
135 <table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>
137 The user interface for the <i>slant</i> command is counter-intuitive.
138 Perhaps it would be better to have a scheme for sweeping out a
139 parallelogram.<br>
141 </table>
143 <td width=20>
144 <tr height=20><td>
145 </table>
146 <!-- TRAILER -->
147 <table border=0 cellpadding=0 cellspacing=0 width=100%>
148 <tr height=15><td width=10><td><td width=10>
149 <tr><td><td>
150 <center>
151 <a href="../../"><img src="../../dist/spaceglenda100.png" alt="Space Glenda" border=1></a>
152 </center>
153 </table>
154 <!-- TRAILER -->
155 </body></html>