sfgraph belongs to the family of plotting programs and is used for plotting explicitly defined 2-D curves.

Here are 10 basic facts about this program:

  1. sfgraph shares most of its parameters with some other 2-D plotting programs (sfgrey, sfcontour, sfwiggle). These common parameters can be accessed by running sfdoc stdplot. The following plot from rsf/rsf/sfgraph is using parameters grid=y gridcol=5 pad=n and some creative changes of fonts in the title.
  2. If the input to sfgraph is real, it is understood as representing a regularly sampled 1-D function Y(X), where X is sampled according to n1=, o1=, and d1= parameters in the input file.
  3. If the input is complex, its real part is taken as X, and the imaginary part is taken as Y. If the input is real initially, it is easy to turn it into complex by using sfcmplx or sfdd.
  4. If the n2 parameter in the input is greater than 1, multiple curves are plotted. The following plot from rsf/rsf/sfmath shows plots of closed curves defined by a complex-valued input.
  5. If the n3 or any of the larger dimensions is greater than 1, the plot becomes a movie.
  6. By default, the graphs are plotted with lines. One can control the line appearance with generic parameters dash=, plotcol=, plotfat=.
    The following plot from jsg/seislet/sin2 contained dashed lines created with dash=1,2,0.
  7. If symbol= is specified, the graph is plotted with the given symbols. The size of the symbol is controlled with symbolsz=. The following plot from sep/precon/oned is created with symbol=”md” symbolsz=7.
  8. The displayed function can be changed from $Y(X)$ to $X(Y)$ by using transp= parameter. The following plot from jsg/nmo3/azimuthtest is created with transp=y yreverse=y symbol=+ symbolsz=4.
  9. The ranges of $X$ and $Y$ are selected automatically but can be controlled with min1=, max1=, min2=, max2=.
    If you want automatic ranges, but no padding around minimum and maximum values, use pad=n.
  10. sfgraph avoids plotting infinite or NaN (not a number) values.