Graph

From Notes_Wiki
Revision as of 10:52, 9 September 2018 by Saurabh (talk | contribs)

<yambe:breadcrumb self="Graph">Image processing tools|Image processing tools</yambe:breadcrumb>

graph

graph utility gets installed when one installs 'plotutils' package. Graph can be used to draw various types of graphs that one may need. It is highly configurable and supports many different output formats. Information on how to use grapht can be obtained using 'info graph' or 'graph --help' options.

Sample input file for graph

1 1
2 2
3 30
4 4
5 5
6 60
7 7
8 8
9 90
10 10

Sample commands for drawing graph

graph -C --output-format X --x-label "X_label" --y-label "Y_label" \
    --input-format a --line-mode 1 <file1.txt>
graph -C --output-format svg --x-label "X_label" --y-label "Y_label" \
    --input-format a --line-mode 1 <file1.txt> > <file1>.svg
graph -C --output-format png --x-label "X_label" --y-label "Y_label" \
    --input-format a --line-mode 1 <file1.txt> > <file1>.png

where

  • '-C or --toggle-use-color' is for color
  • '--output-format' is used for specifying output format. Many formats including png, svg, fig, tex, etc. are supported
  • '--x-label' is to provide label for X axis
  • '--y-label' is used to provide label for Y axis
  • '--input-format a' is used to indicate ASCII input format with two floating point values per line
  • '--line-mode 1' allows choosing solid line in case we do not use -C. With -C line-mode allows selection of both line-mode and line-color


<yambe:breadcrumb self="Graph">Image processing tools|Image processing tools</yambe:breadcrumb>