2015-11-29 23:06:55 +00:00
|
|
|
.TH FPLOT 1
|
2012-11-05 17:38:39 +00:00
|
|
|
.SH NAME
|
|
|
|
fplot \- plot elementary function
|
2018-03-20 17:24:26 +00:00
|
|
|
.SH SYNOPSIS
|
2012-11-05 17:38:39 +00:00
|
|
|
.B fplot
|
|
|
|
[
|
|
|
|
.B -c
|
|
|
|
[
|
|
|
|
.B -s
|
|
|
|
.I size
|
|
|
|
]] [
|
|
|
|
.B -r
|
|
|
|
.I range
|
|
|
|
]
|
|
|
|
.I functions ...
|
|
|
|
.SH DESCRIPTION
|
|
|
|
.I Fplot
|
|
|
|
plots elementary
|
|
|
|
.I functions
|
|
|
|
separated by spaces. The default output is the screen, but if the
|
|
|
|
.B -c
|
|
|
|
option is specified, the plot is written to the standard output as an r8g8b8
|
|
|
|
.IR image (6).
|
|
|
|
The latter image size is either 640x480 or the one specified by the
|
|
|
|
.B -s
|
|
|
|
option's argument (in the WIDTHxHEIGHT format). The
|
|
|
|
.B -r
|
|
|
|
option accepts as argument the x and y ranges, in the format
|
|
|
|
.LR "xmin:xmax ymin:ymax".
|
2018-05-20 09:14:16 +00:00
|
|
|
By default
|
|
|
|
.I fplot
|
|
|
|
draws coordinate axes and tick marks; the
|
|
|
|
.B -a
|
|
|
|
option inhibits this.
|
2012-11-05 17:38:39 +00:00
|
|
|
.PP
|
|
|
|
Each function to be plotted may be a combination of the independent variable x,
|
2015-02-05 18:55:46 +00:00
|
|
|
the elementary operations (+, -, *, / and %), and the functions described in
|
2012-11-05 17:38:39 +00:00
|
|
|
.IR sin (2)
|
|
|
|
and
|
|
|
|
.IR exp (2).
|
|
|
|
The exception being that x^n raises x to the nth power, log is the base 10 logarithm,
|
|
|
|
and ln is the natural logarithm.
|
|
|
|
.SH EXAMPLES
|
|
|
|
Plot the absolute value and x^3 functions to a 400x400 image(6) on standard output and view with
|
|
|
|
.IR page (1).
|
|
|
|
.IP
|
|
|
|
.EX
|
2020-11-27 09:35:57 +00:00
|
|
|
fplot -c -s 400x400 'abs(x)' 'x^3' | page
|
2012-11-05 17:38:39 +00:00
|
|
|
.EE
|
|
|
|
.SH SOURCE
|
|
|
|
.B /sys/src/cmd/fplot.c
|
|
|
|
.SH SEE ALSO
|
|
|
|
.IR exp (2),
|
|
|
|
.IR sin (2),
|
|
|
|
.IR image (6),
|
|
|
|
.IR plot (1).
|
|
|
|
.SH DIAGNOSTICS
|
|
|
|
.I Fplot
|
|
|
|
either exits with
|
|
|
|
.LR "syntax error"
|
|
|
|
or an empty status.
|
2015-11-27 21:49:19 +00:00
|
|
|
.SH BUGS
|
|
|
|
There is no unary plus or minus.
|
2018-05-20 09:14:16 +00:00
|
|
|
.PP
|
|
|
|
Axes are not drawn in
|
|
|
|
.B -c
|
|
|
|
output.
|
2013-12-27 21:22:05 +00:00
|
|
|
.SH HISTORY
|
|
|
|
.I Fplot
|
|
|
|
first appeared in 9front (July, 2011).
|