View
212
Download
0
Embed Size (px)
gnuplot 4.6
An Interactive Plotting Program
Thomas Williams & Colin Kelley
Version 4.6 organized by: Hans-Bernhard Broker, Ethan A Merritt, and others
Major contributors (alphabetic order):Hans-Bernhard Broker, John Campbell,Robert Cunningham, David Denholm,
Gershon Elber, Roger Fearick,Carsten Grammes, Lucas Hart,
Lars Hecking, Peter Juhasz,Thomas Koenig, David Kotz,Ed Kubaitis, Russell Lang,
Timothee Lecomte, Alexander Lehmann,Alexander Mai, Bastian Markisch,
Ethan A Merritt, Petr Mikulk,Carsten Steger, Shigeharu Takeno,Tom Tkacik, Jos Van der Woude,
James R. Van Zandt, Alex Woo, Johannes ZellnerCopyright c 1986 - 1993, 1998, 2004 Thomas Williams, Colin Kelley
Copyright c 2004 - 2012 various authors
Mailing list for comments: gnuplot-info@lists.sourceforge.netMailing list for bug reports: gnuplot-bugs@lists.sourceforge.net
Web access (preferred): http://sourceforge.net/projects/gnuplot
This manual was originally prepared by Dick Crawford.
2012 Version 4.6
2 gnuplot 4.6 CONTENTS
Contents
I Gnuplot 16
Copyright 16
Introduction 16
Seeking-assistance 17
New features 18
New syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Local customization of linetypes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
New plot styles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Revised polar axes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
New smoothing algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
New time/date handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Statistical summary of data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
New or revised terminal drivers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Backwards compatibility 20
Batch/Interactive Operation 20
Canvas size 21
Command-line-editing 21
Comments 22
Coordinates 22
Datastrings 23
Enhanced text mode 23
Environment 24
Expressions 25
Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Elliptic integrals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Random number generator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Unary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Binary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Ternary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
CONTENTS gnuplot 4.6 3
Summation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Gnuplot-defined variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
User-defined variables and functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Fonts 31
Cairo (pdfcairo, pngcairo, epscairo, wxt terminals) . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Gd (png, gif, jpeg terminals) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Postscript (also encapsulated postscript *.eps) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Glossary 33
Linetypes, colors, and styles 33
Colorspec . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Background color . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Linecolor variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Rgbcolor variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Linestyles vs linetypes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Mouse input 36
Bind . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Bind space . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Mouse variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Plotting 38
Start-up (initialization) 38
String constants and string variables 38
Substitution and Command line macros 39
Substitution of system commands in backquotes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Substitution of string variables as macros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
String variables, macros, and command line substitution . . . . . . . . . . . . . . . . . . . . . . . . 40
Syntax 41
Quote Marks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Time/Date data 42
II Plotting styles 42
Boxerrorbars 43
Boxes 43
Boxplot 44
4 gnuplot 4.6 CONTENTS
Boxxyerrorbars 45
Candlesticks 45
Circles 46
Ellipses 46
Dots 47
Filledcurves 47
Financebars 48
Fsteps 49
Fillsteps 49
Histeps 49
Histograms 49
Newhistogram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
Automated iteration over multiple columns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Image 52
Transparency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Image failsafe . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
Impulses 53
Labels 53
Lines 53
Linespoints 54
Points 54
Polar 54
Steps 54
Rgbalpha 54
Rgbimage 55
Vectors 55
Xerrorbars 55
Xyerrorbars 55
CONTENTS gnuplot 4.6 5
Yerrorbars 56
Xerrorlines 56
Xyerrorlines 56
Yerrorlines 57
3D (surface) plots 57
2D projection (set view map) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
III Commands 57
Cd 58
Call 58
Clear 59
Do 59
Evaluate 59
Exit 60
Fit 60
Adjustable parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Short introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
Error estimates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
Statistical overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Practical guidelines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
Control variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
Environment variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Multi-branch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Starting values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Tips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
Help 66
History 67
If 67
If-old . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
Iteration 68
Load 68
6 gnuplot 4.6 CONTENTS
Lower 69
Pause 69
Plot 70
Axes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
Binary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
Array . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
Record . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
Skip . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
Endian . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Filetype . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Avs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Edf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Png . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .