| <head> |
| <title>gview(1) - Plan 9 from User Space</title> |
| <meta content="text/html; charset=utf-8" http-equiv=Content-Type> |
| </head> |
| <body bgcolor=#ffffff> |
| <table border=0 cellpadding=0 cellspacing=0 width=100%> |
| <tr height=10><td> |
| <tr><td width=20><td> |
| <tr><td width=20><td><b>GVIEW(1)</b><td align=right><b>GVIEW(1)</b> |
| <tr><td width=20><td colspan=2> |
| <br> |
| <p><font size=+1><b>NAME </b></font><br> |
| |
| <table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td> |
| |
| gview – interactive graph viewer<br> |
| |
| </table> |
| <p><font size=+1><b>SYNOPSIS </b></font><br> |
| |
| <table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td> |
| |
| <tt><font size=+1>gview</font></tt> [ <tt><font size=+1>−l</font></tt> <i>logfile</i> ] [ <tt><font size=+1>−m</font></tt> ] [ <i>file</i> ]<br> |
| |
| </table> |
| <p><font size=+1><b>DESCRIPTION </b></font><br> |
| |
| <table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td> |
| |
| <i>Gview</i> reads polygonal lines or a polygonal line drawing from an |
| <tt><font size=+1>ASCII</font></tt> input file (which defaults to standard input), and views |
| it interactively, with commands to zoom in and out, perform simple |
| editing operations, and display information about points and polylines. |
| The editing commands can change the color and |
| thickness of the polylines, delete (or undelete) some of them, |
| and optionally rotate and move them. It is also possible to generate |
| an output file that reflects these changes and is in the same |
| format as the input. |
| <table border=0 cellpadding=0 cellspacing=0><tr height=5><td></table> |
| |
| Since the <tt><font size=+1>move</font></tt> and <tt><font size=+1>rotate</font></tt> commands are undesirable when just viewing |
| a graph, they are only enabled if <i>gview</i> is invoked with the <tt><font size=+1>−m</font></tt> |
| option. |
| <table border=0 cellpadding=0 cellspacing=0><tr height=5><td></table> |
| |
| Clicking on a polyline with button 1 displays the coordinates |
| and a <i>t</i> value that tells how far along the polyline. <i>(t</i>=0 at the |
| first vertex, <i>t</i>=1 at the first vertex, <i>t</i>=1.5 halfway between the |
| second and third vertices, etc.) The <tt><font size=+1>−l</font></tt> option generates a log |
| file that lists all points selected in this manner. |
| <table border=0 cellpadding=0 cellspacing=0><tr height=5><td></table> |
| |
| The most important interactive operations are to <i>zoom in</i> by sweeping |
| out a rectangle, or to <i>zoom out</i> so that everything currently being |
| displayed shrinks to fit in the swept-out rectangle. Other options |
| on the button 3 menu are <i>unzoom</i> which restores the coordinate |
| system to the default state where everything fits on |
| the screen, <i>recenter</i> which takes a point and makes it the center |
| of the window, and <i>square up</i> which makes the horizontal and vertical |
| scale factors equal. |
| <table border=0 cellpadding=0 cellspacing=0><tr height=5><td></table> |
| |
| To take a graph of a function where some part is almost linear |
| and see how it deviates from a straight line, select two points |
| on this part of the graph (i.e., select one with button 1 and |
| then select the other) and then use the <i>slant</i> command on the button |
| 3 menu. This slants the coordinate system so that the line |
| between the two selected points appears horizontal (but vertical |
| still means positive <i>y</i>). Then the <i>zoom in</i> command can be used |
| to accentuate deviations from horizontal. There is also an <i>unslant</i> |
| command that undoes all of this and goes back to an unslanted |
| coordinate system. |
| <table border=0 cellpadding=0 cellspacing=0><tr height=5><td></table> |
| |
| There is a <i>recolor</i> command on button 3 that lets you select a |
| color and change everything to have that color, and a similar |
| command on button 2 that only affects the selected polyline. The |
| <i>thick</i> or <i>thin</i> command on button 2 changes the thickness of the |
| selected polyline and there is also an undo command for such |
| edits. |
| <table border=0 cellpadding=0 cellspacing=0><tr height=5><td></table> |
| |
| Finally, button 3 had commands to <i>read</i> a new input file and display |
| it on top of everything else, <i>restack</i> the drawing order (in case |
| lines of different color are drawn on top of each other), <i>write</i> |
| everything into an output file, or <i>exit</i> the program. |
| <table border=0 cellpadding=0 cellspacing=0><tr height=5><td></table> |
| |
| Each polyline in an input or output file is a space-delimited |
| <i>x y</i> coordinate pair on a line by itself, and the polyline is a |
| sequence of such vertices followed by a label. The label could |
| be just a blank line or it could be a string in double quotes, |
| or virtually any text that does not contain spaces and is on a |
| line by itself. The |
| label at the end of the last polyline is optional. It is not legal |
| to have two consecutive labels, since that would denote a zero-vertex |
| polyline and each polyline must have at least one vertex. (One-vertex |
| polylines are useful for scatter plots.)<br> |
| If the label after a polyline can contains the word <tt><font size=+1>Thick</font></tt> or a |
| 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>, |
| <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>), |
| whichever color name comes first will be used to color the polyline. |
| |
| </table> |
| <p><font size=+1><b>EXAMPLE </b></font><br> |
| |
| <table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td> |
| |
| To see a graph of the function <i>y</i>=<i>sin(</i>x<i>)/</i>x generate input with |
| an awk script and pipe it into <i>gview</i>:<br> |
| |
| <table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td> |
| |
| <tt><font size=+1>awk 'BEGIN{for(x=.1;x<500;x+=.1)print x,sin(x)/x}' | gview<br> |
| </font></tt> |
| </table> |
| |
| </table> |
| <p><font size=+1><b>SOURCE </b></font><br> |
| |
| <table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td> |
| |
| <tt><font size=+1>/usr/local/plan9/src/cmd/draw/gview.c<br> |
| </font></tt> |
| </table> |
| <p><font size=+1><b>SEE ALSO </b></font><br> |
| |
| <table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td> |
| |
| <a href="../man1/awk.html"><i>awk</i>(1)</a><br> |
| |
| </table> |
| <p><font size=+1><b>BUGS </b></font><br> |
| |
| <table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td> |
| |
| The user interface for the <i>slant</i> command is counter-intuitive. |
| Perhaps it would be better to have a scheme for sweeping out a |
| parallelogram.<br> |
| |
| </table> |
| |
| <td width=20> |
| <tr height=20><td> |
| </table> |
| <!-- TRAILER --> |
| <table border=0 cellpadding=0 cellspacing=0 width=100%> |
| <tr height=15><td width=10><td><td width=10> |
| <tr><td><td> |
| <center> |
| <a href="../../"><img src="../../dist/spaceglenda100.png" alt="Space Glenda" border=1></a> |
| </center> |
| </table> |
| <!-- TRAILER --> |
| </body></html> |