Blame


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