View
213
Download
0
Embed Size (px)
gnuplot 4.7
An Interactive Plotting Program
Thomas Williams & Colin Kelley
Version 4.7 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 - 2011 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.7 (cvs)
2 gnuplot 4.7 CONTENTS
Contents
I Gnuplot 16
Copyright 16
Introduction 16
Seeking-assistance 17
New features 18
Deprecated syntax 18
Batch/Interactive Operation 19
Canvas size 19
Command-line-editing 20
Comments 20
Coordinates 20
Datastrings 21
Enhanced text mode 21
Environment 22
Expressions 23
Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Elliptic integrals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Random number generator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Unary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Binary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Ternary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Summation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Gnuplot-defined variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
User-defined variables and functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Fonts 29
Cairo (pdfcairo, pngcairo, epscairo, wxt terminals) . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Gd (png, gif, jpeg terminals) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Postscript (also encapsulated postscript *.eps) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
CONTENTS gnuplot 4.7 3
Glossary 31
Iteration 31
Linetypes, colors, and styles 32
Colorspec . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Background color . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Linecolor variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Rgbcolor variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Linestyles vs linetypes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Mouse input 34
Bind . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Bind space . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Mouse variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Plotting 36
Start-up (initialization) 37
String constants and string variables 37
Substitution and Command line macros 38
Substitution of system commands in backquotes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Substitution of string variables as macros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
String variables, macros, and command line substitution . . . . . . . . . . . . . . . . . . . . . . . . 39
Syntax 39
Quote Marks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Time/Date data 40
II Plotting styles 41
Boxerrorbars 42
Boxes 42
Boxplot 43
Boxxyerrorbars 44
Candlesticks 44
Circles 45
Ellipses 46
4 gnuplot 4.7 CONTENTS
Dots 46
Filledcurves 47
Financebars 48
Fsteps 48
Fillsteps 48
Histeps 48
Histograms 49
Newhistogram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
Automated iteration over multiple columns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Image 52
Transparency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
Image failsafe . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
Impulses 53
Labels 53
Lines 54
Linespoints 54
Points 54
Polar 55
Steps 55
Rgbalpha 55
Rgbimage 55
Vectors 55
Xerrorbars 56
Xyerrorbars 56
Yerrorbars 57
Xerrorlines 57
Xyerrorlines 57
Yerrorlines 58
CONTENTS gnuplot 4.7 5
3D (surface) plots 58
2D projection (set view map) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
III Commands 59
Cd 59
Call 59
Clear 60
Do 60
Evaluate 61
Exit 61
Fit 61
Adjustable parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Short introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Error estimates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
Statistical overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
Practical guidelines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Control variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
Environment variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
Multi-branch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
Starting values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
Tips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
Help 68
History 68
If 68
If-old . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
For 69
Load 69
Lower 70
Pause 70
Plot 71
Axes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
6 gnuplot 4.7 CONTENTS
Binary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
Array . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Record . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Skip . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Endian . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
Filetype . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
Avs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
Edf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
Png . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
Keywords . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
Scan . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
Transpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
Dx, dy, dz . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
Flipx, flipy, flipz . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
Origin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
Center . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
Rotate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
Perpendicular . . . . . . . . . . . . . . .