forked from Reen/gnuplot
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathgnuplot.doc
More file actions
13160 lines (11366 loc) · 548 KB
/
gnuplot.doc
File metadata and controls
13160 lines (11366 loc) · 548 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
C RCS $Id: gnuplot.doc,v 1.690 2011/09/23 16:34:28 sfeam Exp $
C
C Copyright (C) 1986 - 1993, 1998, 1999, 2000, 2001, 2004 Thomas Williams, Colin Kelley et al.
C
1 gnuplot
?gnuplot
^<h2 align="center"> An Interactive Plotting Program </h2>
^<p align="center"> Thomas Williams & Colin Kelley</p>
^<p align="center"> Version 4.4 organized by Ethan A Merritt and others</p>
^<p align="center">Major contributors (alphabetic order):<br>
^<br>
^ Hans-Bernhard Broeker, John Campbell,<br>
^ Robert Cunningham, David Denholm,<br>
^ Gershon Elber, Roger Fearick,<br>
^ Carsten Grammes, Lucas Hart,<br>
^ Lars Hecking, Péter Juhász,<br>
^ Thomas Koenig, David Kotz,<br>
^ Ed Kubaitis, Russell Lang,<br>
^ Timothée Lecomte, Alexander Lehmann,<br>
^ Alexander Mai, Bastian Märkisch,<br>
^ Ethan A Merritt, Petr Mikulík,<br>
^ Carsten Steger, Shigeharu Takeno,<br>
^ Tom Tkacik, Jos Van der Woude,<br>
^ James R. Van Zandt, Alex Woo, Johannes Zellner<br>
^</p>
^<p align="center"> Copyright (C) 1986 - 1993, 1998 - 2004 Thomas Williams, Colin Kelley<br>
^ Copyright (C) 2004 - 2011 various authors</p>
^<p align="center"> Mailing list for comments: <tt>gnuplot-info@lists.sourceforge.net</tt><br>
^ Mailing list for bug reports: <tt>gnuplot-bugs@lists.sourceforge.net</tt><br>
^ Web access (preferred): <tt>http://sourceforge.net/projects/gnuplot</tt></p>
^<p align="center"> This manual was originally prepared by Dick Crawford</p>
2 Copyright
?copyright
?license
Copyright (C) 1986 - 1993, 1998, 2004, 2007 Thomas Williams, Colin Kelley
Permission to use, copy, and distribute this software and its
documentation for any purpose with or without fee is hereby granted,
provided that the above copyright notice appear in all copies and
that both that copyright notice and this permission notice appear
in supporting documentation.
Permission to modify the software is granted, but not the right to
distribute the complete modified source code. Modifications are to
be distributed as patches to the released version. Permission to
distribute binaries produced by compiling modified sources is granted,
provided you
1. distribute the corresponding source modifications from the
released version in the form of a patch file along with the binaries,
2. add special version identification to distinguish your version
in addition to the base release version number,
3. provide your name and address as the primary contact for the
support of your modified version, and
4. retain our contact information in regard to use of the base
software.
Permission to distribute the released version of the source code along
with corresponding source modifications in the form of a patch file is
granted with same provisions 2 through 4 for binary distributions.
This software is provided "as is" without express or implied warranty
to the extent permitted by applicable law.
AUTHORS
Original Software:
Thomas Williams, Colin Kelley.
Gnuplot 2.0 additions:
Russell Lang, Dave Kotz, John Campbell.
Gnuplot 3.0 additions:
Gershon Elber and many others.
Gnuplot 4.0 additions:
See list of contributors at head of this document.
2 Introduction
?introduction
?
`Gnuplot` is a portable command-line driven graphing utility for Linux, OS/2,
MS Windows, OSX, VMS, and many other platforms. The source code is copyrighted
but freely distributed (i.e., you don't have to pay for it). It was originally
created to allow scientists and students to visualize mathematical functions
and data interactively, but has grown to support many non-interactive uses
such as web scripting. It is also used as a plotting engine by third-party
applications like Octave. Gnuplot has been supported and under active
development since 1986.
Gnuplot supports many types of plots in either 2D and 3D. It can draw using
lines, points, boxes, contours, vector fields, surfaces, and various
associated text. It also supports various specialized plot types.
Gnuplot supports many different types of output: interactive screen terminals
(with mouse and hotkey input), direct output to pen plotters or modern
printers, and output to many file formats (eps, emf, fig, jpeg, LaTeX, pdf, png,
postscript, ...). Gnuplot is easily extensible to include new output modes.
Recent additions include interactive terminals based on wxWidgets (usable
on multiple platforms), and Qt. Mouseable plots embedded in web pages
can be generated using the svg or HTML5 canvas terminal drivers.
The command language of `gnuplot` is case sensitive, i.e. commands and
function names written in lowercase are not the same as those written in
capitals. All command names may be abbreviated as long as the abbreviation is
not ambiguous. Any number of commands may appear on a line, separated by
semicolons (;). Strings may be set off by either single or double quotes,
although there are some subtle differences. See `syntax` and `quotes` for
more details. Examples:
load "filename"
cd 'dir'
Commands may extend over several input lines by ending each line but the last
with a backslash (\). The backslash must be the _last_ character on each
line. The effect is as if the backslash and newline were not there. That
is, no white space is implied, nor is a comment terminated. Therefore,
commenting out a continued line comments out the entire command
(see `comments`). But note that if an error occurs somewhere on a multi-line
command, the parser may not be able to locate precisely where the error is
and in that case will not necessarily point to the correct line.
In this document, curly braces ({}) denote optional arguments and a vertical
bar (|) separates mutually exclusive choices. `Gnuplot` keywords or `help`
topics are indicated by backquotes or `boldface` (where available). Angle
brackets (<>) are used to mark replaceable tokens. In many cases, a default
value of the token will be taken for optional arguments if the token is
omitted, but these cases are not always denoted with braces around the angle
brackets.
For built-in help on any topic, type `help` followed by the name of the topic
or `help ?` to get a menu of available topics.
The new `gnuplot` user should begin by reading about `plotting` (if in an
interactive session, type `help plotting`).
See the simple.dem demo, also available together with other demos on the web page
^ <a href="http://www.gnuplot.info/demo/">
http://www.gnuplot.info/demo/
^ </a>
`Gnuplot` can be started from a command line or from an icon according to the
desktop environment. Running it from command line can take the syntax
gnuplot {OPTIONS} file1 file2 ...
where file1, file2, etc. are input file as in the `load` command.
On X11-based systems, you can use
gnuplot {X11OPTIONS} {OPTIONS} file1 file2 ...
see your X11 documentation or rather `x11` in this document.
Options interpreted by gnuplot may come anywhere on the line. Files are
executed in the order specified, as are commands supplied by the -e option,
for example
gnuplot file1.in -e "reset" file2.in
The special filename "-" is used to force reading from stdin. `Gnuplot` exits
after the last file is processed. If no load files are named, `Gnuplot` takes
interactive input from stdin. See help `batch/interactive` for more details.
The options specific to gnuplot can be listed by typing
gnuplot --help
See `command line options` for more details.
Hit 'h' for help about `hotkeys` and `mousing` features in interactive screen
terminals (`pm`, `windows`, `wxt`, `x11`).
Section `seeking-assistance` will help you to find further information, help
and FAQ.
2 Seeking-assistance
?help-desk
?seeking-assistance
The canonical gnuplot web page can be found at
^ <a href="http://www.gnuplot.info">
http://www.gnuplot.info
^ </a>
Before seeking help, please check file FAQ.pdf or the above website for
^ <a href="http://www.gnuplot.info/faq/">
FAQ (Frequently Asked Questions) list.
^ </a>
If you need help as a gnuplot user, please use the newsgroup
comp.graphics.apps.gnuplot
We prefer that you read the messages through the newsgroup rather than
subscribing to the mailing list which is also available and carries the same
set of messages. Instructions for subscribing to gnuplot mailing lists may be
found via the gnuplot development website on SourceForge
^ <a href="http://sourceforge.net/projects/gnuplot">
http://sourceforge.net/projects/gnuplot
^ </a>
The address for mailing to list members is:
gnuplot-info@lists.sourceforge.net
Bug reports and code contributions should be uploaded to the trackers at
http://sourceforge.net/projects/gnuplot/support
Please check previous bug reports if the bug you want to report has not been
already fixed in a newer version of gnuplot.
The list of those interested in development version of gnuplot is:
gnuplot-beta@lists.sourceforge.net
When posting a question, please include full details of the gnuplot version,
the terminal type, and the operating system you are using. A _small_ script
demonstrating the problem may be useful. Function plots are preferable to
datafile plots.
2 New features
?new-features
This section lists major additions since version 4.4.
For a more exhaustive list, see the NEWS file.
3 New syntax
Ffigure_newsyntax
This version of gnuplot introduces command iteration and block-structured
if/else/while/do constructs. See `if`, `while`, and `do`.
Simple iteration is possible inside `plot` or `set` commands.
See `iteration`. General iteration spanning multiple
commands is possible using a block construct as shown below.
For a related new feature, see the `summation` expression type.
Here is an example using several of these new syntax features:
set multiplot layout 2,2
fourier(k, x) = sin(3./2*k)/k * 2./3*cos(k*x)
do for [power = 0:3] {
TERMS = 10**power
set title sprintf("%g term Fourier series",TERMS)
plot 0.5 + sum [k=1:TERMS] fourier(k,x) notitle
}
unset multiplot
It is now possible to select a column of data from a data file by
matching a label in the first row of the file. See `columnhead`.
For example
plot for [crop in "Oats Peas Beans"] 'data' using "Year":crop
3 User preferences for linetypes
You can now customize properties (color, linewidth, point type) of the
default sequence of linetypes used in plotting. See `set linetype`.
3 New plot styles
See documentation for plot styles `boxplot`, `circles`, `ellipses`, and
`fillsteps`.
3 Revised polar axes
Polar plot mode has been reworked to support additional plot styles.
The polar axes can now be drawn and labeled independent of the x and y
axes. See `set polar` and `set rrange`.
3 New or revised terminal drivers
The `qt` driver implements an interactive terminal on top of the Qt
graphics layer. It can function either as a window in a full-featured
desktop enviroment or as a full-screen application on a Qt-based
embedded device. The `qt` terminal is new and may still have some
rough edges.
Two terminal types support web-based interactive display. The HTML5 `canvas`
terminal was introduced in version 4.4. The `svg` terminal has been extensively
revised to include support for mousing and better incorporation of svg plots
from gnuplot into larger svg/xml documents.
The `canvas` terminal driver produces javascript output that draws onto the
HTML canvas element of a web page. It can produce either a complete web page
containing a single plot, or a script that can be embedded as part of an
externally generated HTML document that perhaps contains multiple plots.
The embedded plots support browser-side mousing, including zoom/unzoom.
The `lua` terminal driver creates an data intended to be further processed
by a script in the lua programming language. At this point only one such
lua script, gnuplot-tikz.lua, is available. It produces a TeX document
suitable for use with the latex TikZ package. Other lua scripts could be
written to process the gnuplot output for use with other TeX packages,
or with other non-TeX tools.
`Set term tikz` is shorthand for `set term lua tikz`. As decribed above, it
uses the generic lua terminal and an external lua script to produce a latex
document.
3 New smoothing algorithms
=kdensity
=cumulative
New smoothing algorithms have been added for both 2- and 3-dimensional plots.
`smooth kdensity` and `smooth cumulative` can be used with `plot` to draw
smooth histograms and cumulative distribution functions. Several new smoothing
kernels have been added to `dgrid3d` for use with `splot`.
See `smooth` `dgrid3d`.
3 New time/date handling
=time
Gnuplot now tracks time to millisecond precision. Time formats have been
modified to match this. The new built-in function time() returns the current
time of day according to the system clock.
Example: print the current time to msec precision
print strftime("%H:%M:%.3S %d-%b-%Y",time(0.0))
18:15:04.253 16-Apr-2011
2 Backwards compatibility
?backwards compatibility
?compatibility
Gnuplot version 4.0 deprecated certain syntax used in earlier versions, but
continued to recognize it. This is now under the control of a configuration
option, and can be disabled as follows:
./configure --disable-backwards-compatibility
Notice: Deprecated syntax items may be disabled permanently in some future
version of gnuplot.
One major difference is the introduction of keywords to disambiguate complex
commands, particularly commands containing string variables. A notable issue
was the use of bare numbers to specify offsets, line and point types.
Illustrative examples:
Deprecated:
set title "Old" 0,-1
set data linespoints
plot 1 2 4 # horizontal line at y=1
New:
TITLE = "New"
set title TITLE offset char 0, char -1
set style data linespoints
plot 1 linetype 2 pointtype 4
2 Batch/Interactive Operation
?batch/interactive
?command line options
`Gnuplot` may be executed in either batch or interactive modes, and the two
may even be mixed together on many systems.
Any command-line arguments are assumed to be either program options (first
character is -) or names of files containing `gnuplot` commands. The option
-e "command" may be used to force execution of a gnuplot command. Each file
or command string will be executed in the order specified. The special
filename "-" is indicates that commands are to be read from stdin.
`Gnuplot` exits after the last file is processed. If no load files and no
command strings are specified, `gnuplot` accepts interactive input from
stdin.
Both the `exit` and `quit` commands terminate the current command file and
`load` the next one, until all have been processed.
Examples:
To launch an interactive session:
gnuplot
To launch a batch session using two command files "input1" and "input2":
gnuplot input1 input2
To launch an interactive session after an initialization file "header" and
followed by another command file "trailer":
gnuplot header - trailer
To give `gnuplot` commands directly in the command line, using the "-persist"
option so that the plot remains on the screen afterwards:
gnuplot -persist -e "set title 'Sine curve'; plot sin(x)"
To set user-defined variables a and s prior to executing commands from a file:
gnuplot -e "a=2; s='file.png'" input.gpl
2 Canvas size
?canvas size
?canvas
?set term size
In earlier versions of gnuplot, some terminal types used the values from
`set size` to control also the size of the output canvas; others did not.
The use of 'set size' for this purpose was deprecated in version 4.2.
Since version 4.4 almost all terminals now behave as follows:
`set term <terminal_type> size <XX>, <YY>` controls the size of the output
file, or "canvas". Please see individual terminal documentation for allowed
values of the size parameters. By default, the plot will fill this canvas.
`set size <XX>, <YY>` scales the plot itself relative to the size of the
canvas. Scale values less than 1 will cause the plot to not fill the entire
canvas. Scale values larger than 1 will cause only a portion of the plot to
fit on the canvas. Please be aware that setting scale values larger than 1
may cause problems on some terminal types.
The major exception to this convention is the PostScript driver, which
by default continues to act as it has in earlier versions. Be warned that
the next version of gnuplot may change the default behaviour of the
PostScript driver as well.
Example:
set size 0.5, 0.5
set term png size 600, 400
set output "figure.png"
plot "data" with lines
These commands will produce an output file "figure.png" that is 600 pixels
wide and 400 pixels tall. The plot will fill the lower left quarter of this
canvas. This is consistent with the way multiplot mode has always worked.
2 Command-line-editing
?line-editing
?editing
?command-line-editing
Command-line editing and command history are supported using either an
external gnu readline library, an external BSD libedit library, or a
built-in equivalent. This choice is a configuration option at the time
gnuplot is built.
The editing commands of the built-in version are given below. Please note that
the action of the DEL key is system-dependent. The gnu readline and BSD libedit
libraries have their own documentation.
@start table - first is interactive cleartext form
`Line-editing`:
^B moves back a single character.
^F moves forward a single character.
^A moves to the beginning of the line.
^E moves to the end of the line.
^H deletes the previous character.
DEL deletes the current character.
^D deletes current character, sends EOF if the line is empty.
^K deletes from current position to the end of line.
^L,^R redraws line in case it gets trashed.
^U deletes the entire line.
^W deletes previous word.
`History`:
^P moves back through history.
^N moves forward through history.
#\begin{tabular}{|cl|} \hline
#\multicolumn{2}{|c|}{Command-line Editing Commands} \\ \hline \hline
#Character & Function \\ \hline
# & \multicolumn{1}{|c|}{Line Editing}\\ \cline{2-2}
#\verb~^B~ & move back a single character.\\
#\verb~^F~ & move forward a single character.\\
#\verb~^A~ & move to the beginning of the line.\\
#\verb~^E~ & move to the end of the line.\\
#\verb~^H~ & delete the previous character.\\
#\verb~DEL~ & delete the current character.\\
#\verb~^D~ & delete current character. EOF if line is empty.\\
#\verb~^K~ & delete from current position to the end of line.\\
#\verb~^L, ^R~ & redraw line in case it gets trashed.\\
#\verb~^U~ & delete the entire line. \\
#\verb~^W~ & delete previous word. \\ \hline
# & \multicolumn{1}{|c|}{History} \\ \cline{2-2}
#\verb~^P~ & move back through history.\\
#\verb~^N~ & move forward through history.\\
%c l .
%Character@Function
%_
%@Line Editing
%^B@move back a single character.
%^F@move forward a single character.
%^A@move to the beginning of the line.
%^E@move to the end of the line.
%^H@delete the previous character.
%DEL@delete the current character.
%^D@delete current character. EOF if line is empty.
%^K@delete from current position to the end of line.
%^L, ^R@redraw line in case it gets trashed.
%^U@delete the entire line.
%^W@delete previous word.
%_
%@History
%^P@move back through history.
%^N@move forward through history.
@end table
^<table align="center" border="1" rules="groups" frame="hsides" cellpadding="3">
^<colgroup>
^ <col align="center">
^ <col align="left">
^</colgroup>
^<thead>
^<tr> <th>Character</th> <th>Function</th></tr>
^</thead>
^<tbody>
^<tr> <td></td> <th>Line Editing</th></tr>
^<tr> <td><tt>^B</tt></td> <td>move back a single character.</td></tr>
^<tr> <td><tt>^F</tt></td> <td>move forward a single character.</td></tr>
^<tr> <td><tt>^A</tt></td> <td>move to the beginning of the line.</td></tr>
^<tr> <td><tt>^E</tt></td> <td>move to the end of the line.</td></tr>
^<tr> <td><tt>^H</tt></td> <td>delete the previous character.</td></tr>
^<tr> <td><tt>DEL</tt></td> <td>delete the current character.</td></tr>
^<tr> <td><tt>^D</tt></td> <td>delete current character. EOF if line is empty</td></tr>
^<tr> <td><tt>^K</tt></td> <td>delete from current position to the end of line.</td></tr>
^<tr> <td><tt>^L, ^R</tt></td> <td>redraw line in case it gets trashed.</td></tr>
^<tr> <td><tt>^U</tt></td> <td>delete the entire line.</td></tr>
^<tr> <td><tt>^W</tt></td> <td>delete previous word.</td></tr>
^</tbody>
^<tbody>
^<tr> <th></th> <th>History</th></tr>
^<tr> <td><tt>^P</tt></td> <td>move back through history.</td></tr>
^<tr> <td><tt>^N</tt></td> <td>move forward through history.</td></tr>
^</tbody>
^</table>
2 Comments
?comments
Comments are supported as follows: a `#` may appear in most places in a line
and `gnuplot` will ignore the rest of the line. It will not have this effect
inside quotes, inside numbers (including complex numbers), inside command
substitutions, etc. In short, it works anywhere it makes sense to work.
See also `set datafile commentschars` for specifying comment characters in
data files. Note that if a comment line ends in '\' then the subsequent
line is also treated as a comment.
2 Coordinates
?coordinates
=axes
The commands `set arrow`, `set key`, `set label` and `set object` allow you
to draw something at an arbitrary position on the graph. This position is
specified by the syntax:
{<system>} <x>, {<system>} <y> {,{<system>} <z>}
Each <system> can either be `first`, `second`, `graph`, `screen`, or
`character`.
`first` places the x, y, or z coordinate in the system defined by the left
and bottom axes; `second` places it in the system defined by the second axes
(top and right); `graph` specifies the area within the axes---0,0 is bottom
left and 1,1 is top right (for splot, 0,0,0 is bottom left of plotting area;
use negative z to get to the base---see `set xyplane`); `screen`
specifies the screen area (the entire area---not just the portion selected by
`set size`), with 0,0 at bottom left and 1,1 at top right; and `character`
gives the position in character widths and heights from the bottom left of
the screen area (screen 0,0), `character` coordinates depend on the chosen
font size.
If the coordinate system for x is not specified, `first` is used. If the
system for y is not specified, the one used for x is adopted.
In some cases, the given coordinate is not an absolute position but a
relative value (e.g., the second position in `set arrow` ... `rto`). In
most cases, the given value serves as difference to the first position.
If the given coordinate resides in a logarithmic axis the value is
interpreted as factor. For example,
set logscale x
set arrow 100,5 rto 10,2
plots an arrow from position 100,5 to position 1000,7 since the x axis is
logarithmic while the y axis is linear.
If one (or more) axis is timeseries, the appropriate coordinate should
be given as a quoted time string according to the `timefmt` format string.
See `set xdata` and `set timefmt`. `Gnuplot` will also accept an integer
expression, which will be interpreted as seconds from 1 January 2000.
2 Datastrings
?datastrings
Data files may contain string data consisting of either an arbitrary string
of printable characters containing no whitespace or an arbitrary string of
characters, possibly including whitespace, delimited by double quotes.
The following sample line from a datafile is interpreted to contain four
columns, with a text field in column 3:
1.000 2.000 "Third column is all of this text" 4.00
Text fields can be positioned within a 2-D or 3-D plot using the commands:
plot 'datafile' using 1:2:4 with labels
splot 'datafile using 1:2:3:4 with labels
A column of text data can also be used to label the ticmarks along one or more
of the plot axes. The example below plots a line through a series of points
with (X,Y) coordinates taken from columns 3 and 4 of the input datafile.
However, rather than generating regularly spaced tics along the x axis
labeled numerically, gnuplot will position a tic mark along the x axis at the
X coordinate of each point and label the tic mark with text taken from column
1 of the input datafile.
set xtics
plot 'datafile' using 3:4:xticlabels(1) with linespoints
=columnheader
There is also an option that will interpret the first entry in a column of
input data (i.e. the column heading) as a text field, and use it as the key
title for data plotted from that column. The example given below will use the
first entry in column 2 to generate a title in the key box, while processing
the remainder of columns 2 and 4 to draw the required line:
plot 'datafile' using 1:(f($2)/$4) with lines title columnhead(2)
Another example:
plot for [i=2:6] 'datafile' using i title "Results for ".columnhead(i)
See `set style labels`, `using xticlabels`, `plot title`, `using`.
2 Enhanced text mode
?enhanced text
?enhanced
Many terminal types support an enhanced text mode in which additional
formatting information is embedded in the text string. For example, "x^2"
will write x-squared as we are used to seeing it, with a superscript 2.
This mode is normally selected when you set the terminal, e.g.
"set term png enhanced", but may also be toggled afterward using
"set termoption enhanced", or by marking individual strings as in
"set label 'x_2' noenhanced".
@start table - first is interactive cleartext form
Control Examples Explanation
^ a^x superscript
_ a_x subscript
@ @x or a@^b_{cd} phantom box (occupies no width)
& &{space} inserts space of specified length
~ ~a{.8-} overprints '-' on 'a', raised by .8
times the current fontsize
#\begin{tabular}{|cccl|} \hline
#\multicolumn{4}{|c|}{Enhanced Text Control Codes} \\ \hline
#Control & Example & Result & Explanation \\ \hline
#\verb~^~ & \verb~a^x~ & $a^x$ & superscript\\
#\verb~_~ & \verb~a_x~ & $a_x$ & subscript\\
#\verb~@~ & \verb~a@^b_{cd}~ & $a^b_{cd}$ &phantom box (occupies no width)\\
#\verb~&~ & \verb~d&{space}b~ & d\verb*+ +b & inserts space of specified length\\
#\verb|~| & \verb|~a{.8-}| & $\tilde{a}$ & overprints '-' on 'a', raised by .8\\
#\verb~ ~ & \verb~ ~ & ~ ~ & times the current fontsize\\
%c c l .
%.TE", /* ugly - doc2ms uses @ for column separator, but here we */
%.TS", /* need @ in table, so end and restart the table ! */
%center box tab ($) ;
%c c l .
%Control$Examples$Explanation
%_
%^$a^x$superscript
%\&_$a\&_x$subscript
% @ $ @x or a\&@^b\&_{cd}$phantom box (occupies no width)
% & $ &{space}$inserts space of specified length
% ~ $ ~a{.8-}$overprints '-' on 'a', raised by .8
% $ $times the current fontsize
@end table
^<table align="center" border="1" rules="groups" frame="hsides" cellpadding="3">
^<colgroup>
^ <col align="center">
^ <col align="center">
^ <col align="left">
^</colgroup>
^<thead>
^<tr> <th>Control</th> <th>Examples</th> <th>Explanation</th></tr>
^</thead>
^<tbody>
^<tr> <td><tt> ^ </tt></td> <td><tt>a^x</tt></td> <td>superscript</td></tr>
^<tr> <td><tt> _ </tt></td> <td><tt>a_x</tt></td> <td>subscript</td></tr>
^<tr> <td><tt> @ </tt></td> <td><tt> @x</tt> or <tt>a@^b_{cd}</tt></td> <td>phantom box (occupies no width)</td></tr>
^<tr> <td><tt> &</tt></td> <td><tt> &{space}</tt></td> <td>inserts space of specified length</td></tr>
^<tr> <td><tt> ~ </tt></td> <td><tt> ~a{.8-}</tt></td> <td>overprints '-' on 'a', raised by .8<br>times the current fontsize</td></tr>
^</tbody>
^</table>
Braces can be used to place multiple-character text where a single character
is expected (e.g., 2^{10}). To change the font and/or size, use the full form:
{/[fontname][=fontsize | *fontscale] text}. Thus {/Symbol=20 G} is a 20 pt
GAMMA and {/*0.75 K} is a K at three-quarters of whatever fontsize is currently
in effect. (The '/' character MUST be the first character after the '{'.)
The phantom box is useful for a@^b_c to align superscripts and subscripts
but does not work well for overwriting an accent on a letter. For the latter,
it is much better to use an encoding (e.g. iso_8859_1 or utf8) that contains
a large variety of letters with accents or other diacritical marks. See
`set encoding`. Since the box is non-spacing, it is sensible to put the shorter
of the subscript or superscript in the box (that is, after the @).
Space equal in length to a string can be inserted using the '&' character.
Thus
'abc&{def}ghi'
would produce
'abc ghi'.
The '~' character causes the next character or bracketed text to be
overprinted by the following character or bracketed text. The second text
will be horizontally centered on the first. Thus '~a/' will result in an 'a'
with a slash through it. You can also shift the second text vertically by
preceding the second text with a number, which will define the fraction of the
current fontsize by which the text will be raised or lowered. In this case
the number and text must be enclosed in brackets because more than one
character is necessary. If the overprinted text begins with a number, put a
space between the vertical offset and the text ('~{abc}{.5 000}'); otherwise
no space is needed ('~{abc}{.5---}'). You can change the font for one or
both strings ('~a{.5 /*.2 o}'---an 'a' with a one-fifth-size 'o' on top---and
the space between the number and the slash is necessary), but you can't
change it after the beginning of the string. Neither can you use any other
special syntax within either string. You can, of course, use control
characters by escaping them (see below), such as '~a{\^}'
You can access special symbols numerically by specifying \character-code (in
octal), e.g., {/Symbol \245} is the symbol for infinity. This does not work
for multibyte encodings like UTF-8, however. In a UTF-8 environment, you
should be able to enter multibyte sequences implicitly by typing or otherwise
selecting the character you want.
You can escape control characters using \, e.g., \\, \{, and so on.
But be aware that strings in double-quotes are parsed differently than those
enclosed in single-quotes. The major difference is that backslashes may need
to be doubled when in double-quoted strings.
Examples (these are hard to describe in words---try them!):
set xlabel 'Time (10^6 {/Symbol m}s)'
set title '{/Symbol=18 \\362@_{/=9.6 0}^{/=12 x}} \\
{/Helvetica e^{-{/Symbol m}^2/2} d}{/Symbol m}'
The file "ps_guide.ps" in the /docs/psdoc subdirectory of the gnuplot source
distribution contains more examples of the enhanced syntax.
2 Environment
?environment
A number of shell environment variables are understood by `gnuplot`. None of
these are required, but may be useful.
If GNUTERM is defined, it is used as the name of the terminal type to be
used. This overrides any terminal type sensed by `gnuplot` on start-up, but
is itself overridden by the .gnuplot (or equivalent) start-up file
(see `startup`) and, of course, by later explicit changes.
GNUHELP may be defined to be the pathname of the HELP file (gnuplot.gih).
On VMS, the logical name GNUPLOT$HELP should be defined as the name of the
help library for `gnuplot`. The `gnuplot` help can be put inside any system
help library, allowing access to help from both within and outside `gnuplot`
if desired.
On Unix, HOME is used as the name of a directory to search for a .gnuplot
file if none is found in the current directory. On MS-DOS, Windows and OS/2,
GNUPLOT is used. On Windows, the NT-specific variable USERPROFILE is also
tried. VMS, SYS$LOGIN: is used. Type `help startup`.
On Unix, PAGER is used as an output filter for help messages.
On Unix, SHELL is used for the `shell` command. On MS-DOS and OS/2, COMSPEC
is used for the `shell` command.
FIT_SCRIPT may be used to specify a `gnuplot` command to be executed when a
fit is interrupted---see `fit`. FIT_LOG specifies the default filename of the
logfile maintained by fit.
GNUPLOT_LIB may be used to define additional search directories for data
and command files. The variable may contain a single directory name, or
a list of directories separated by a platform-specific path separator,
eg. ':' on Unix, or ';' on DOS/Windows/OS/2 platforms. The contents
of GNUPLOT_LIB are appended to the `loadpath` variable, but not saved
with the `save` and `save set` commands.
Several gnuplot terminal drivers access TrueType fonts via the gd library.
For these drivers the font search path is controlled by the environmental
variable GDFONTPATH. Furthermore, a default font for these drivers may be
set via the environmental variable GNUPLOT_DEFAULT_GDFONT.
The postscript terminal uses its own font search path. It is controlled by
the environmental variable GNUPLOT_FONTPATH. The format is the same as for
GNUPLOT_LIB. The contents of GNUPLOT_FONTPATH are appended to the `fontpath`
variable, but not saved with the `save` and `save set` commands.
GNUPLOT_PS_DIR is used by the postscript driver to search for external
prologue files. Depending on the build process, gnuplot contains either a
built-in copy of those files or a default hardcoded path. You can use this
variable have the postscript terminal use custom prologue files rather than
the default files. See `postscript prologue`.
2 Expressions
?expressions
In general, any mathematical expression accepted by C, FORTRAN, Pascal, or
BASIC is valid. The precedence of these operators is determined by the
specifications of the C programming language. White space (spaces and tabs)
is ignored inside expressions.
Complex constants are expressed as {<real>,<imag>}, where <real> and <imag>
must be numerical constants. For example, {3,2} represents 3 + 2i; {0,1}
represents 'i' itself. The curly braces are explicitly required here.
=division
Note that gnuplot uses both "real" and "integer" arithmetic, like FORTRAN and
C. Integers are entered as "1", "-10", etc; reals as "1.0", "-10.0", "1e1",
3.5e-1, etc. The most important difference between the two forms is in
division: division of integers truncates: 5/2 = 2; division of reals does
not: 5.0/2.0 = 2.5. In mixed expressions, integers are "promoted" to reals
before evaluation: 5/2e0 = 2.5. The result of division of a negative integer
by a positive one may vary among compilers. Try a test like "print -5/2" to
determine if your system chooses -2 or -3 as the answer.
The integer expression "1/0" may be used to generate an "undefined" flag,
which causes a point to ignored; the `ternary` operator gives an example.
Or you can use the pre-defined variable NaN to achieve the same result.
=NaN
The real and imaginary parts of complex expressions are always real, whatever
the form in which they are entered: in {3,2} the "3" and "2" are reals, not
integers.
Gnuplot can also perform simple operations on strings and string variables.
For example, the expression ("A" . "B" eq "AB") evaluates as true, illustrating
the string concatenation operator and the string equality operator.
A string which contains a numerical value is promoted to the corresponding
integer or real value if used in a numerical expression. Thus ("3" + "4" == 7)
and (6.78 == "6.78") both evaluate to true. An integer, but not a real or
complex value, is promoted to a string if used in string concatenation.
A typical case is the use of integers to construct file names or other strings;
e.g. ("file" . 4 eq "file4") is true.
Substrings can be specified using a postfixed range descriptor [beg:end].
For example, "ABCDEF"[3:4] == "CD" and "ABCDEF"[4:*] == "DEF"
The syntax "string"[beg:end] is exactly equivalent to calling the built-in
string-valued function substr("string",beg,end), except that you cannot
omit either beg or end from the function call.
3 Functions
?expressions functions
?functions
The functions in `gnuplot` are the same as the corresponding functions in
the Unix math library, except that all functions accept integer, real, and
complex arguments unless otherwise noted.
Functions that accept or return angles (e.g. sin(x), cos(x), arg(z))
treat angle values as radians, but this may be changed to degrees using the
command `set angles`.
^<table align="center" border="1" rules="groups" frame="hsides" cellpadding="3" width="90%">
^<colgroup>
^ <col align="center">
^ <col align="center">
^ <col align="left">
^</colgroup>
^<thead>
^<tr> <th colspan="3"> Math library functions </th></tr>
^<tr> <th>Function</th> <th>Arguments</th> <th>Returns</th></tr>
^</thead>
^<tbody>
^<tr> <td>abs(x)</td> <td>any</td> <td>|<i>x</i>|, absolute value of <i>x</i>; same type</td></tr>
^<tr> <td>abs(x)</td> <td>complex</td> <td>length of <i>x</i>, √( Re(<i>x</i>)<sup>2</sup> + Im(<i>x</i>)<sup>2</sup> )</td></tr>
^<tr> <td>acos(x)</td> <td>any</td> <td>cos<sup>-1</sup> <i>x</i> (inverse cosine)</td></tr>
^<tr> <td>acosh(x)</td> <td>any</td> <td>cosh<sup>-1</sup> <i>x</i> (inverse hyperbolic cosine) in radians</td></tr>
^<tr> <td>airy(x)</td> <td>any</td> <td>Airy function Ai(<i>x</i>)</td></tr>
^<tr> <td>arg(x)</td> <td>complex</td> <td>the phase of <i>x</i></td></tr>
^<tr> <td>asin(x)</td> <td>any</td> <td>sin<sup>-1</sup> <i>x</i> (inverse sin)</td></tr>
^<tr> <td>asinh(x)</td> <td>any</td> <td>sinh<sup>-1</sup> <i>x</i> (inverse hyperbolic sin) in radians</td></tr>
^<tr> <td>atan(x)</td> <td>any</td> <td>tan<sup>-1</sup> <i>x</i> (inverse tangent)</td></tr>
^<tr> <td>atan2(y,x)</td> <td>int or real</td> <td>tan<sup>-1</sup>(<i>y/x</i>) (inverse tangent)</td></tr>
^<tr> <td>atanh(x)</td> <td>any</td> <td>tanh<sup>-1</sup> <i>x</i> (inverse hyperbolic tangent) in radians</td></tr>
^<tr> <td>EllipticK(k)</td> <td>real k in (-1:1)</td> <td><i>K(k)</i> complete elliptic integral of the first kind</td></tr>
^<tr> <td>EllipticE(k)</td> <td>real k in [-1:1]</td> <td><i>E(k)</i> complete elliptic integral of the second kind</td></tr>
^<tr> <td>EllipticPi(n,k)</td> <td> real n<1, real k in (-1:1)</td> <td> Π(<i>n,k</i>) complete elliptic integral of the third kind</td></tr>
^<tr> <td>besj0(x)</td> <td>int or real</td> <td><i>j</i><sub>0</sub> Bessel function of <i>x</i>, in radians</td></tr>
^<tr> <td>besj1(x)</td> <td>int or real</td> <td><i>j</i><sub>1</sub> Bessel function of <i>x</i>, in radians</td></tr>
^<tr> <td>besy0(x)</td> <td>int or real</td> <td><i>y</i><sub>0</sub> Bessel function of <i>x</i>, in radians</td></tr>
^<tr> <td>besy1(x)</td> <td>int or real</td> <td><i>y</i><sub>1</sub> Bessel function of <i>x</i>, in radians</td></tr>
^<tr> <td>ceil(x)</td> <td>any</td> <td>⌈<i>x</i>⌉, smallest integer not less than <i>x</i> (real part)</td></tr>
^<tr> <td>cos(x)</td> <td>radians</td> <td>cos <i>x</i>, cosine of <i>x</i></td></tr>
^<tr> <td>cosh(x)</td> <td>any</td> <td>cosh <i>x</i>, hyperbolic cosine of <i>x</i> in radians</td></tr>
^<tr> <td>erf(x)</td> <td>any</td> <td>erf(Re(<i>x</i>)), error function of real(<i>x</i>)</td></tr>
^<tr> <td>erfc(x)</td> <td>any</td> <td>erfc(Re(<i>x</i>)), 1.0 - error function of real(<i>x</i>)</td></tr>
^<tr> <td>exp(x)</td> <td>any</td> <td><i>e<sup>x</sup></i>, exponential function of <i>x</i></td></tr>
^<tr> <td>expint(n,x)</td> <td>any</td> <td><i>E<sub>n</sub></i>(<i>x</i>), exponential integral function of <i>x</i></td></tr>
^<tr> <td>floor(x)</td> <td>any</td> <td>⌊<i>x</i>⌋, largest integer not greater than <i>x</i> (real part)</td></tr>
^<tr> <td>gamma(x)</td> <td>any</td> <td>Γ(Re(<i>x</i>)), gamma function of real(<i>x</i>)</td></tr>
^<tr> <td>ibeta(p,q,x)</td> <td>any</td> <td>ibeta(Re(<i>p,q,x</i>)), ibeta function of real(<i>p</i>,<i>q</i>,<i>x</i>)</td></tr>
^<tr> <td>inverf(x)</td> <td>any</td> <td>inverse error function real(<i>x</i>)</td></tr>
^<tr> <td>igamma(a,x)</td> <td>any</td> <td>igamma(Re(<i>a,x</i>)), igamma function of real(<a>a</a>,<i>x</i>)</td></tr>
^<tr> <td>imag(x)</td> <td>complex</td> <td>Im(<i>x</i>), imaginary part of <i>x</i> as a real number</td></tr>
^<tr> <td>invnorm(x)</td> <td>any</td> <td>inverse normal distribution function real(<i>x</i>)</td></tr>
^<tr> <td>int(x)</td> <td>real</td> <td>integer part of <i>x</i>, truncated toward zero</td></tr>
^<tr> <td>lambertw(x)</td> <td>real</td> <td>Lambert W function</td></tr>
^<tr> <td>lgamma(x)</td> <td>any</td> <td>lgamma(Re(<i>x</i>)), lgamma function of real(<i>x</i>)</td></tr>
^<tr> <td>log(x)</td> <td>any</td> <td>ln <i>x</i>, natural logarithm (base <i>e</i>) of <i>x</i></td></tr>
^<tr> <td>log10(x)</td> <td>any</td> <td>log<sub>10</sub> <i>x</i>, logarithm (base 10) of <i>x</i></td></tr>
^<tr> <td>norm(x)</td> <td>any</td> <td>norm(<i>x</i>), normal distribution function of real(<i>x</i>)</td></tr>
^<tr> <td>rand(x)</td> <td>int</td> <td>pseudo random number in the interval [0:1]</td></tr>
^<tr> <td>real(x)</td> <td>any</td> <td>Re(<i>x</i>), real part of <i>x</i></td></tr>
^<tr> <td>sgn(x)</td> <td>any</td> <td>1 if <i>x</i> > 0, -1 if <i>x</i> < 0, 0 if <i>x</i> = 0. ℑ(<i>x</i>) ignored</td></tr>
^<tr> <td>sin(x)</td> <td>any</td> <td>sin <i>x</i>, sine of <i>x</i></td></tr>
^<tr> <td>sinh(x)</td> <td>any</td> <td>sinh <i>x</i>, hyperbolic sine of <i>x</i> in radians</td></tr>
^<tr> <td>sqrt(x)</td> <td>any</td> <td>√<i>x</i>, square root of <i>x</i></td></tr>
^<tr> <td>tan(x)</td> <td>any</td> <td>tan <i>x</i>, tangent of <i>x</i></td></tr>
^<tr> <td>tanh(x)</td> <td>any</td> <td>tanh <i>x</i>, hyperbolic tangent of <i>x</i> in radians</td></tr>
^<tr> <td>voigt(x,y)</td> <td>real</td> <td>convolution of Gaussian and Lorentzian</td></tr>
^</tbody>
^</table>
^<p> </p>
^<table align="center" border="1" rules="groups" frame="hsides" cellpadding="3" width="90%">
^<colgroup>
^ <col align="center">
^ <col align="center">
^ <col align="left">
^</colgroup>
^<thead>
^<tr> <th colspan="3"> String functions </th></tr>
^<tr> <th>Function</th> <th>Arguments</th> <th>Returns</th></tr>
^</thead>
^<tbody>
^<tr> <td>gprintf("format",x,...)</td> <td>any</td> <td>string result from applying gnuplot's format parser</td></tr>
^<tr> <td>sprintf("format",x,...)</td> <td>multiple</td> <td>string result from C-language sprintf</td></tr>
^<tr> <td>strlen("string")</td> <td>string</td> <td>int length of string</td></tr>
^<tr> <td>strstrt("string","key")</td> <td>strings</td> <td>int index of first character of substring "key"</td></tr>
^<tr> <td>substr("string",beg,end)</td> <td>multiple</td> <td>string "string"[beg:end]</td></tr>
^<tr> <td>strftime("timeformat",t)</td> <td>any</td> <td>string result from applying gnuplot's time parser</td></tr>
^<tr> <td>strptime("timeformat",s)</td> <td>string</td> <td>seconds since year 2000 as given in string s</td></tr>
^<tr> <td>system("command")</td> <td>string</td> <td>string containing output stream of shell command</td></tr>
^<tr> <td>word("string",n)</td> <td>string, int</td> <td>returns the nth word in "string"</td></tr>
^<tr> <td>words("string")</td> <td>string</td> <td>returns the number of words in "string"</td></tr>
^</tbody>
^</table>
^<p> </p>
^<table align="center" border="1" rules="groups" frame="hsides" cellpadding="3" width="90%">
^<colgroup>
^ <col align="center">
^ <col align="center">
^ <col align="left">
^</colgroup>
^<thead>
^<tr> <th colspan="3"> other gnuplot functions </th></tr>
^<tr> <th>Function</th> <th>Arguments</th> <th>Returns</th></tr>
^</thead>
^<tbody>
^<tr> <td>column(x)</td> <td>int or string</td> <td> contents of column <i>x</i> during data input.</td></tr>
^<tr> <td>columnhead(x)</td> <td>int</td> <td> string containing first entry of column <i>x</i> in datafile.</td></tr>
^<tr> <td>defined(X)</td> <td>variable name</td> <td> [DEPRECATED] returns 1 if X is defined, 0 otherwise.</td></tr>
^<tr> <td>exists("X")</td> <td>string</td> <td> returns 1 if a variable named X is defined, 0 otherwise.</td></tr>
^<tr> <td>stringcolumn(x)</td> <td>int</td> <td> content column <i>x</i> as a string.</td></tr>
^<tr> <td>timecolumn(x)</td> <td>int</td> <td> timecolumn <i>x</i> during datafile manipulation.</td></tr>
^<tr> <td>tm_hour(x)</td> <td>int</td> <td>the hour</td></tr>
^<tr> <td>tm_mday(x)</td> <td>int</td> <td>the day of the month</td></tr>
^<tr> <td>tm_min(x)</td> <td>int</td> <td>the minute</td></tr>
^<tr> <td>tm_mon(x)</td> <td>int</td> <td>the month</td></tr>
^<tr> <td>tm_sec(x)</td> <td>int</td> <td>the second</td></tr>
^<tr> <td>tm_wday(x)</td> <td>int</td> <td>the day of the week</td></tr>
^<tr> <td>tm_yday(x)</td> <td>int</td> <td>the day of the year</td></tr>
^<tr> <td>tm_year(x)</td> <td>int</td> <td>the year</td></tr>
^<tr> <td>time(x)</td> <td>any</td> <td>the current system time</td></tr>
^<tr> <td>valid(x)</td> <td>int</td> <td> test validity of column(<i>x</i>) during datafile manip.</td></tr>
^<tr> <td>value("name")</td> <td>string</td> <td> returns the current value of the named variable.</td></tr>
^</tbody>
^</table>
C For TeX and troff output a table replaces the help sections below.
C For the HTML help we want both, table and sections, so the magic
C marker below is used to signal this to doc2html:
^<!-- INCLUDE_NEXT_TABLE -->
@start table
#\begin{tabular}{|ccl|} \hline
#\multicolumn{3}{|c|}{Math library functions} \\ \hline \hline
#Function & Arguments & Returns \\ \hline
%c c l .
%Function@Arguments@Returns
%_
4 abs
?expressions functions abs
?functions abs
?abs
#abs(x) & any & absolute value of $x$, $|x|$; same type \\
#abs(x) & complex & length of $x$, $\sqrt{{\mbox{real}(x)^{2} +
#\mbox{imag}(x)^{2}}}$ \\
%abs(x)@any@absolute value of $x$, $|x|$; same type
%abs(x)@complex@length of $x$, $sqrt{roman real (x) sup 2 + roman imag (x) sup 2}$
The `abs(x)` function returns the absolute value of its argument. The
returned value is of the same type as the argument.
For complex arguments, abs(x) is defined as the length of x in the complex
plane [i.e., sqrt(real(x)**2 + imag(x)**2) ].
4 acos
?expressions functions acos
?functions acos
?acos
#acos(x) & any & $\cos^{-1} x$ (inverse cosine) \\
%acos(x)@any@$cos sup -1 x$ (inverse cosine)
The `acos(x)` function returns the arc cosine (inverse cosine) of its
argument. `acos` returns its argument in radians or degrees, as selected by
`set angles`.
4 acosh
?expressions functions acosh
?functions acosh
?acosh
#acosh(x) & any & $\cosh^{-1} x$ (inverse hyperbolic cosine) in radians \\
%acosh(x)@any@$cosh sup -1 x$ (inverse hyperbolic cosine) in radians
The `acosh(x)` function returns the inverse hyperbolic cosine of its argument
in radians.
4 airy
?expressions functions airy
?functions airy
?airy
#airy(x) & any & Airy function Ai(x) \\
%airy(x)@any@Airy function Ai(x)
The `airy(x)` function returns the value of the Airy function Ai(x) of its
argument. The function Ai(x) is that solution of the equation y'' - x y = 0
which is everywhere finite. If the argument is complex, its imaginary part
is ignored.
4 arg
?expressions functions arg
?functions arg
?arg
#arg(x) & complex & the phase of $x$ \\
%arg(x)@complex@the phase of $x$
The `arg(x)` function returns the phase of a complex number in radians or
degrees, as selected by `set angles`.
4 asin
?expressions functions asin
?functions asin
?asin
#asin(x) & any & $\sin^{-1} x$ (inverse sin) \\
%asin(x)@any@$sin sup -1 x$ (inverse sin)
The `asin(x)` function returns the arc sin (inverse sin) of its argument.
`asin` returns its argument in radians or degrees, as selected by `set
angles`.
4 asinh
?expressions functions asinh
?functions asinh
?asinh
#asinh(x) & any & $\sinh^{-1} x$ (inverse hyperbolic sin) in radians \\
%asinh(x)@any@$sinh sup -1 x$ (inverse hyperbolic sin) in radians