-
Notifications
You must be signed in to change notification settings - Fork 56
Expand file tree
/
Copy pathgnuplot.texi
More file actions
12424 lines (9378 loc) · 393 KB
/
gnuplot.texi
File metadata and controls
12424 lines (9378 loc) · 393 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
\input texinfo @c -*-texinfo-*-
@c %**start of header
@setfilename gnuplot.info
@settitle Gnuplot: An Interactive Plotting Program
@setchapternewpage odd
@c %**end of header
@c define the command and options indeces
@defindex cm
@defindex op
@defindex tm
@direntry
* GNUPLOT: (gnuplot). An Interactive Plotting Program
@end direntry
@ifnottex
@node Top, gnuplot, (dir), (dir)
@top Master Menu
@end ifnottex
@example
GNUPLOT
An Interactive Plotting Program
Thomas Williams & Colin Kelley
Version 3.7 organized by: David Denholm
Copyright (C) 1986 - 1993, 1998 Thomas Williams, Colin Kelley
Mailing list for comments: info-gnuplot@@dartmouth.edu
Mailing list for bug reports: bug-gnuplot@@dartmouth.edu
This manual was prepared by Dick Crawford
3 December 1998
Major contributors (alphabetic order):
@end example
@c ^ <h2> An Interactive Plotting Program </h2><p>
@c ^ <h2> Thomas Williams & Colin Kelley</h2><p>
@c ^ <h2> Version 3.7 organized by: David Denholm </h2><p>
@c ^ <h2>Major contributors (alphabetic order):</h2>
@itemize @bullet
@item
Hans-Bernhard Broeker
@item
John Campbell
@item
Robert Cunningham
@item
David Denholm
@item
Gershon Elber
@item
Roger Fearick
@item
Carsten Grammes
@item
Lucas Hart
@item
Lars Hecking
@item
Thomas Koenig
@item
David Kotz
@item
Ed Kubaitis
@item
Russell Lang
@item
Alexander Lehmann
@item
Alexander Mai
@item
Carsten Steger
@item
Tom Tkacik
@item
Jos Van der Woude
@item
James R. Van Zandt
@item
Alex Woo
@end itemize
@c ^<h2> Copyright (C) 1986 - 1993, 1998 Thomas Williams, Colin Kelley<p>
@c ^ Mailing list for comments: info-gnuplot@@dartmouth.edu <p>
@c ^ Mailing list for bug reports: bug-gnuplot@@dartmouth.edu<p>
@c ^</h2><p>
@c ^<h3> This manual was prepared by Dick Crawford</h3><p>
@c ^<h3> 3 December 1998</h3><p>
@c ^<hr>
@menu
* gnuplot::
* Commands::
* Graphical_User_Interfaces::
* Bugs::
* Concept_Index::
* Command_Index::
* Options_Index::
* Function_Index::
* Terminal_Index::
@end menu
@node gnuplot, Commands, Top, Top
@chapter gnuplot
@menu
* Copyright::
* Introduction::
* Seeking-assistance::
* What's_New_in_version_3.7::
* bind::
* Batch/Interactive_Operation::
* Command-line-editing::
* Comments::
* Coordinates::
* Environment::
* Expressions::
* Glossary::
* Plotting::
* Start-up::
* Substitution::
* Syntax::
* Time/Date_data::
@end menu
@node Copyright, Introduction, gnuplot, gnuplot
@section Copyright
@cindex copyright
@cindex license
@example
Copyright (C) 1986 - 1993, 1998 Thomas Williams, Colin Kelley
@end example
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
@example
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.
@end example
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.
@example
AUTHORS
@end example
@example
Original Software:
Thomas Williams, Colin Kelley.
@end example
@example
Gnuplot 2.0 additions:
Russell Lang, Dave Kotz, John Campbell.
@end example
@example
Gnuplot 3.0 additions:
Gershon Elber and many others.
@end example
@node Introduction, Seeking-assistance, Copyright, gnuplot
@section Introduction
@cindex introduction
@c ?
`gnuplot` is a command-driven interactive function and data plotting program.
It is case sensitive (commands and function names written in lowercase are
not the same as those written in CAPS). All command names may be abbreviated
as long as the abbreviation is not ambiguous. Any number of commands may
appear on a line (with the exception that `load` or @ref{call} must be the final
command), separated by semicolons (;). Strings are indicated with quotes.
They may be either single or double quotation marks, e.g.,
@example
load "filename"
cd 'dir'
@end example
although there are some subtle differences (see `syntax` for more details).
Any command-line arguments are assumed to be names of files containing
`gnuplot` commands, with the exception of standard X11 arguments, which are
processed first. Each file is loaded with the `load` command, in the order
specified. `gnuplot` exits after the last file is processed. When no load
files are named, `gnuplot` enters into an interactive mode. The special
filename "-" is used to denote standard input. See "help batch/interactive"
for more details.
Many `gnuplot` commands have multiple options. These options must appear in
the proper order, although unwanted ones may be omitted in most cases. Thus
if the entire command is "command a b c", then "command a c" will probably
work, but "command c a" will fail.
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
`comment`). 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 @ref{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 on-line help on any topic, type @ref{help} followed by the name of the topic
or just @ref{help} or `?` to get a menu of available topics.
The new `gnuplot` user should begin by reading about `plotting` (if on-line,
type `help plotting`).
@uref{http://www.nas.nasa.gov/~woo/gnuplot/simple/simple.html,Simple Plots Demo }
@node Seeking-assistance, What's_New_in_version_3.7, Introduction, gnuplot
@section Seeking-assistance
@cindex seeking-assistance
There is a mailing list for `gnuplot` users. Note, however, that the
newsgroup
@example
comp.graphics.apps.gnuplot
@end example
is identical to the mailing list (they both carry the same set of messages).
We prefer that you read the messages through the newsgroup rather than
subscribing to the mailing list. Administrative requests should be sent to
@example
majordomo@@dartmouth.edu
@end example
Send a message with the body (not the subject) consisting of the single word
"help" (without the quotes) for more details.
The address for mailing to list members is:
@example
info-gnuplot@@dartmouth.edu
@end example
Bug reports and code contributions should be mailed to:
@example
bug-gnuplot@@dartmouth.edu
@end example
The list of those interested in beta-test versions is:
@example
info-gnuplot-beta@@dartmouth.edu
@end example
There is also a World Wide Web page with up-to-date information, including
known bugs:
@uref{http://www.cs.dartmouth.edu/gnuplot_info.html,http://www.cs.dartmouth.edu/gnuplot_info.html
}
Before seeking help, please check the
@uref{http://www.uni-karlsruhe.de/~ig25/gnuplot-faq.html,FAQ (Frequently Asked Questions) list.
}
If you do not have a copy of the FAQ, you may request a copy by email from
the Majordomo address above, ftp a copy from
@example
ftp://ftp.dartmouth.edu/pub/gnuplot
@end example
or see the WWW `gnuplot` page.
When posting a question, please include full details of the version of
`gnuplot`, the machine, and operating system you are using. A _small_ script
demonstrating the problem may be useful. Function plots are preferable to
datafile plots. If email-ing to info-gnuplot, please state whether or not
you are subscribed to the list, so that users who use news will know to email
a reply to you. There is a form for such postings on the WWW site.
@node What's_New_in_version_3.7, bind, Seeking-assistance, gnuplot
@section What's New in version 3.7
@cindex new-features
Gnuplot version 3.7 contains many new features. This section gives a partial
list and links to the new items in no particular order.
1. `fit f(x) 'file' via` uses the Marquardt-Levenberg method to fit data.
(This is only slightly different from the `gnufit` patch available for 3.5.)
2. Greatly expanded @ref{using} command. See @ref{using}.
3. @ref{timefmt} allows for the use of dates as input and output for time
series plots. See `Time/Date data` and
@uref{http://www.nas.nasa.gov/~woo/gnuplot/timefmt/timefmt.html,timedat.dem.
}
4. Multiline labels and font selection in some drivers.
5. Minor (unlabeled) tics. See @ref{mxtics}.
6. @ref{key} options for moving the key box in the page (and even outside of the
plot), putting a title on it and a box around it, and more. See @ref{key}.
7. Multiplots on a single logical page with @ref{multiplot}.
8. Enhanced `postscript` driver with super/subscripts and font changes.
(This was a separate driver (`enhpost`) that was available as a patch for
3.5.)
9. Second axes: use the top and right axes independently of the bottom and
left, both for plotting and labels. See @ref{plot}.
10. Special datafile names `'-'` and `""`. See @ref{special-filenames}.
11. Additional coordinate systems for labels and arrows. See `coordinates`.
12. @ref{size} can try to plot with a specified aspect ratio.
13. @ref{missing} now treats missing data correctly.
14. The @ref{call} command: `load` with arguments.
15. More flexible `range` commands with `reverse`, `writeback`, and `restore`
keywords.
16. @ref{encoding} for multi-lingual encoding.
17. New `x11` driver with persistent and multiple windows.
18. New plotting styles: @ref{xerrorbars}, @ref{errorlines}, @ref{yerrorlines},
@ref{xerrorlines}, @ref{xyerrorlines}, @ref{histeps}, @ref{financebars} and more.
See @ref{style}.
19. New tic label formats, including `"%l %L"` which uses the mantissa and
exponents to a given base for labels. See `set format`.
20. New drivers, including `cgm` for inclusion into MS-Office applications
and `gif` for serving plots to the WEB.
21. Smoothing and spline-fitting options for @ref{plot}. See @ref{smooth}.
22. @ref{margin} and @ref{origin} give much better control over where a
graph appears on the page.
23. @ref{border} now controls each border individually.
24. The new commands @ref{if} and @ref{reread} allow command loops.
25. Point styles and sizes, line types and widths can be specified on the
@ref{plot} command. Line types and widths can also be specified for grids,
borders, tics and arrows. See @ref{with}. Furthermore these types may be
combined and stored for further use. See `set style line`.
26. Text (labels, tic labels, and the time stamp) can be written vertically
by those terminals capable of doing so.
@node bind, Batch/Interactive_Operation, What's_New_in_version_3.7, gnuplot
@section bind
@c ?commands bind
@cindex bind
The @ref{bind} command allows to (re-)define a sequence of gnuplot commands
which will be executed when a certain key or key sequence is pressed
while the driver's window has the input focus.
Note that @ref{bind} is only available if gnuplot was compiled with mouse
support and it is used by all mouse-capable terminals.
Bindings overwrite the builtin bindings (like in every real editor),
except <space> and 'q' which cannot be rebound.
Mouse Buttons cannot be rebound.
Note that multikey-bindings with modifiers have to be quoted.
Syntax:
@example
bind [<key-sequence>] ["<gnuplot commands>"]
bind!
@end example
Examples:
- set bindings:
@example
bind a "replot"
bind "ctrl-a" "plot x*x"
bind "ctrl-alt-a" 'print "great"'
bind Home "set view 60,30; replot"
@end example
- show bindings:
@example
bind "ctrl-a" # shows the binding for ctrl-a
bind # shows all bindings
@end example
- remove bindings:
@example
bind "ctrl-alt-a" "" # removes binding for ctrl-alt-a
(note that builtins cannot be removed)
bind! # installs default (builtin) bindings
@end example
- bind a key to toggle something:
@example
v=0
bind "ctrl-r" "v=v+1;if(v%2)set term x11 noraise; else set term x11 raise"
@end example
Modifiers (ctrl / alt) are case insensitive, keys not:
@example
ctrl-alt-a == CtRl-alT-a
ctrl-alt-a != ctrl-alt-A
@end example
List of modifiers (alt == meta):
@example
ctrl, alt
@end example
List of supported special keys:
@example
"BackSpace", "Tab", "Linefeed", "Clear", "Return", "Pause", "Scroll_Lock",
"Sys_Req", "Escape", "Delete", "Home", "Left", "Up", "Right", "Down",
"PageUp", "PageDown", "End", "Begin",
@end example
@example
"KP_Space", "KP_Tab", "KP_Enter", "KP_F1", "KP_F2", "KP_F3", "KP_F4",
"KP_Home", "KP_Left", "KP_Up", "KP_Right", "KP_Down", "KP_PageUp",
"KP_PageDown", "KP_End", "KP_Begin", "KP_Insert", "KP_Delete", "KP_Equal",
"KP_Multiply", "KP_Add", "KP_Separator", "KP_Subtract", "KP_Decimal",
"KP_Divide",
@end example
@example
"KP_1" - "KP_9", "F1" - "F12"
@end example
see also @ref{mouse} and @ref{if}.
@node Batch/Interactive_Operation, Command-line-editing, bind, gnuplot
@section Batch/Interactive Operation
@cindex batch/interactive
`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 names of files containing
`gnuplot` commands (with the exception of standard X11 arguments, which are
processed first). Each file is loaded with the `load` command, in the order
specified. `gnuplot` exits after the last file is processed. When no load
files are named, `gnuplot` enters into an interactive mode. The special
filename "-" is used to denote standard input.
Both the @ref{exit} and @ref{quit} commands terminate the current command file and
`load` the next one, until all have been processed.
Examples:
To launch an interactive session:
@example
gnuplot
@end example
To launch a batch session using two command files "input1" and "input2":
@example
gnuplot input1 input2
@end example
To launch an interactive session after an initialization file "header" and
followed by another command file "trailer":
@example
gnuplot header - trailer
@end example
@node Command-line-editing, Comments, Batch/Interactive_Operation, gnuplot
@section Command-line-editing
@cindex line-editing
@cindex editing
@cindex history
@cindex command-line-editing
Command-line editing is supported by the Unix, Atari, VMS, MS-DOS and OS/2
versions of `gnuplot`. Also, a history mechanism allows previous commands to
be edited and re-executed. After the command line has been edited, a newline
or carriage return will enter the entire line without regard to where the
cursor is positioned.
(The readline function in `gnuplot` is not the same as the readline used in
GNU Bash and GNU Emacs. If the GNU version is desired, it may be selected
instead of the `gnuplot` version at compile time.)
The editing commands are as follows:
@example
`Line-editing`:
@end example
@example
^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 and DEL delete the previous character.
^D deletes the current character.
^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 the last word.
@end example
@example
`History`:
@end example
@example
^P moves back through history.
^N moves forward through history.
@end example
On the IBM PC, the use of a TSR program such as DOSEDIT or CED may be desired
for line editing. The default makefile assumes that this is the case; by
default `gnuplot` will be compiled with no line-editing capability. If you
want to use `gnuplot`'s line editing, set READLINE in the makefile and add
readline.obj to the link file. The following arrow keys may be used on the
IBM PC and Atari versions if readline is used:
@example
Left Arrow - same as ^B.
Right Arrow - same as ^F.
Ctrl Left Arrow - same as ^A.
Ctrl Right Arrow - same as ^E.
Up Arrow - same as ^P.
Down Arrow - same as ^N.
@end example
The Atari version of readline defines some additional key aliases:
@example
Undo - same as ^L.
Home - same as ^A.
Ctrl Home - same as ^E.
Esc - same as ^U.
Help - @ref{help} plus return.
Ctrl Help - `help `.
@end example
@node Comments, Coordinates, Command-line-editing, gnuplot
@section Comments
@cindex 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.
@node Coordinates, Environment, Comments, gnuplot
@section Coordinates
@cindex coordinates
The commands @ref{arrow}, @ref{key}, and @ref{label} allow you to draw
something at an arbitrary position on the graph. This position is specified
by the syntax:
@example
@{<system>@} <x>, @{<system>@} <y> @{,@{<system>@} <z>@}
@end example
Each <system> can either be `first`, `second`, `graph` or `screen`.
`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 @ref{ticslevel}); and `screen`
specifies the screen area (the entire area---not just the portion selected by
@ref{size}), with 0,0 at bottom left and 1,1 at top right.
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.
If one (or more) axis is timeseries, the appropriate coordinate should
be given as a quoted time string according to the @ref{timefmt} format string.
See @ref{xdata} and @ref{timefmt}. `gnuplot` will also accept an integer
expression, which will be interpreted as seconds from 1 January 2000.
@node Environment, Expressions, Coordinates, gnuplot
@section Environment
@cindex 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
`start-up`) and, of course, by later explicit changes.
On Unix, AmigaOS, AtariTOS, MS-DOS and OS/2, 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 AmigaOS, AtariTOS,
MS-DOS and OS/2, gnuplot is used. On VMS, SYS$LOGIN: is used. See `help
start-up`.
On Unix, PAGER is used as an output filter for help messages.
On Unix, AtariTOS and AmigaOS, SHELL is used for the @ref{shell} command. On
MS-DOS and OS/2, COMSPEC is used for the @ref{shell} command.
On MS-DOS, if the BGI or Watcom interface is used, PCTRM is used to tell
the maximum resolution supported by your monitor by setting it to
S<max. horizontal resolution>. E.g. if your monitor's maximum resolution is
800x600, then use:
@example
set PCTRM=S800
@end example
If PCTRM is not set, standard VGA is used.
FIT_SCRIPT may be used to specify a `gnuplot` command to be executed when a
fit is interrupted---see `fit`. FIT_LOG specifies the 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/Amiga platforms. The contents
of GNUPLOT_LIB are appended to the @ref{loadpath} variable, but not saved
with the @ref{save} and `save set` commands.
@node Expressions, Glossary, Environment, gnuplot
@section Expressions
@cindex 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.
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.
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.
@menu
* Functions::
* Operators::
* User-defined::
@end menu
@node Functions, Operators, Expressions, Expressions
@subsection Functions
@c ?expressions functions
@cindex functions
@opindex 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.
For those functions that accept or return angles that may be given in either
degrees or radians (sin(x), cos(x), tan(x), asin(x), acos(x), atan(x),
atan2(x) and arg(z)), the unit may be selected by @ref{angles}, which
defaults to radians.
@menu
* abs::
* acos::
* acosh::
* arg::
* asin::
* asinh::
* atan::
* atan2::
* atanh::
* besj0::
* besj1::
* besy0::
* besy1::
* ceil::
* cos::
* cosh::
* erf::
* erfc::
* exp::
* floor::
* gamma::
* ibeta::
* inverf::
* igamma::
* imag::
* invnorm::
* int::
* lgamma::
* log::
* log10::
* norm::
* rand::
* real::
* sgn::
* sin::
* sinh::
* sqrt::
* tan::
* tanh::
* column::
* tm_hour::
* tm_mday::
* tm_min::
* tm_mon::
* tm_sec::
* tm_wday::
* tm_yday::
* tm_year::
* valid::
@end menu
@node abs, acos, Functions, Functions
@subsubsection abs
@c ?expressions functions abs
@c ?functions abs
@cindex abs
@findex abs
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) ].
@node acos, acosh, abs, Functions
@subsubsection acos
@c ?expressions functions acos
@c ?functions acos
@cindex acos
@findex acos
The `acos(x)` function returns the arc cosine (inverse cosine) of its
argument. `acos` returns its argument in radians or degrees, as selected by
@ref{angles}.
@node acosh, arg, acos, Functions
@subsubsection acosh
@c ?expressions functions acosh
@c ?functions acosh
@cindex acosh
@findex acosh
The `acosh(x)` function returns the inverse hyperbolic cosine of its argument
in radians.
@node arg, asin, acosh, Functions
@subsubsection arg
@c ?expressions functions arg
@c ?functions arg
@cindex arg
@findex arg
The `arg(x)` function returns the phase of a complex number in radians or
degrees, as selected by @ref{angles}.
@node asin, asinh, arg, Functions
@subsubsection asin
@c ?expressions functions asin
@c ?functions asin
@cindex asin
@findex asin
The `asin(x)` function returns the arc sin (inverse sin) of its argument.
`asin` returns its argument in radians or degrees, as selected by @ref{angles}.
@node asinh, atan, asin, Functions
@subsubsection asinh
@c ?expressions functions asinh
@c ?functions asinh
@cindex asinh
@findex asinh
The `asinh(x)` function returns the inverse hyperbolic sin of its argument in
radians.
@node atan, atan2, asinh, Functions
@subsubsection atan
@c ?expressions functions atan
@c ?functions atan
@cindex atan
@findex atan
The `atan(x)` function returns the arc tangent (inverse tangent) of its
argument. `atan` returns its argument in radians or degrees, as selected by
@ref{angles}.
@node atan2, atanh, atan, Functions
@subsubsection atan2
@c ?expressions functions atan2
@c ?functions atan2
@cindex atan2
@findex atan2
The `atan2(y,x)` function returns the arc tangent (inverse tangent) of the
ratio of the real parts of its arguments. @ref{atan2} returns its argument in
radians or degrees, as selected by @ref{angles}, in the correct quadrant.
@node atanh, besj0, atan2, Functions
@subsubsection atanh
@c ?expressions functions atanh
@c ?functions atanh
@cindex atanh
@findex atanh
The `atanh(x)` function returns the inverse hyperbolic tangent of its
argument in radians.
@node besj0, besj1, atanh, Functions
@subsubsection besj0
@c ?expressions functions besj0
@c ?functions besj0
@cindex besj0
@findex besj0
The `besj0(x)` function returns the j0th Bessel function of its argument.
@ref{besj0} expects its argument to be in radians.
@node besj1, besy0, besj0, Functions
@subsubsection besj1
@c ?expressions functions besj1
@c ?functions besj1
@cindex besj1
@findex besj1
The `besj1(x)` function returns the j1st Bessel function of its argument.
@ref{besj1} expects its argument to be in radians.
@node besy0, besy1, besj1, Functions
@subsubsection besy0
@c ?expressions functions besy0
@c ?functions besy0
@cindex besy0
@findex besy0
The @ref{besy0} function returns the y0th Bessel function of its argument.
@ref{besy0} expects its argument to be in radians.
@node besy1, ceil, besy0, Functions
@subsubsection besy1
@c ?expressions functions besy1
@c ?functions besy1
@cindex besy1
@findex besy1
The `besy1(x)` function returns the y1st Bessel function of its argument.
@ref{besy1} expects its argument to be in radians.
@node ceil, cos, besy1, Functions
@subsubsection ceil
@c ?expressions functions ceil
@c ?functions ceil
@cindex ceil
@findex ceil
The `ceil(x)` function returns the smallest integer that is not less than its
argument. For complex numbers, @ref{ceil} returns the smallest integer not less
than the real part of its argument.
@node cos, cosh, ceil, Functions
@subsubsection cos