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:

**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.- 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. - 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.
- 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. - If the
**n3**or any of the larger dimensions is greater than 1, the plot becomes a movie. - 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**. - 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**. - 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**. - 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**. **sfgraph**avoids plotting infinite or NaN (not a number) values.

Wei Zhang5 years agoOne question about the command “sfgraph”，How should we display the legends or marks for the multiple lines in the plot

admin5 years agoWe don’t have a legend option yet. You can follow the examples in the post.

Rodolfo Neves (Dirack)4 years agoHello,

I’ve developed a program to produce a seimic trace, everything works fine until I try to plot (Github source code).

I’m receiving this error when I try to plot with

sfgraphprogram:`<receptor.rsf sfgraph | sfpen`

`xtpen: (fatal) (gentext) Attempt to use undefined mark number 0`

I’d like to know what does it mean.

Thank you,

admin4 years agoCheck the output of

`sfin receptor.rsf`

. It looks like the problem is with text in the labels or title, perhaps an unusual symbol.