Click here to load reader
View
252
Download
11
Tags:
Embed Size (px)
DESCRIPTION
1
gnuplot 5.1
An Interactive Plotting Program
Thomas Williams & Colin Kelley
Version 5.1 organized by: Ethan A Merritt and many others
Major contributors (alphabetic order):Christoph Bersch, 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, Jerome Lodewyck,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 - 2014 various authorsMailing list for comments: [email protected]
Mailing list for bug reports: [email protected] access (preferred): http://sourceforge.net/projects/gnuplot
This manual was originally prepared by Dick Crawford.
Version 5.0 (development snapshot May 2014)
2 gnuplot 5.1 CONTENTS
Contents
I Gnuplot 17
Copyright 17
Introduction 17
Seeking-assistance 18
New features in version 5 19
New commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Changes in version 5 20
Deprecated syntax 20
Batch/Interactive Operation 21
Canvas size 22
Command-line-editing 22
Comments 23
Coordinates 23
Datastrings 23
Enhanced text mode 24
Environment 25
Expressions 26
Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Elliptic integrals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Random number generator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Unary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Binary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Ternary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Summation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Gnuplot-defined variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
User-defined variables and functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Fonts 32
Cairo (pdfcairo, pngcairo, epscairo, wxt terminals) . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
CONTENTS gnuplot 5.1 3
Gd (png, gif, jpeg terminals) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Postscript (also encapsulated postscript *.eps) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Glossary 34
Iteration 34
Linetypes, colors, and styles 35
Colorspec . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Background color . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Linecolor variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Rgbcolor variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Dashtype . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Linestyles vs linetypes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Layers 38
Mouse input 38
Bind . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Bind space . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Mouse variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Persist 40
Plotting 40
Start-up (initialization) 41
String constants and string variables 41
Substitution and Command line macros 42
Substitution of system commands in backquotes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Substitution of string variables as macros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
String variables, macros, and command line substitution . . . . . . . . . . . . . . . . . . . . . . . . 43
Syntax 43
Quote Marks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
Time/Date data 44
II Plotting styles 46
Boxerrorbars 46
Boxes 46
Boxplot 47
4 gnuplot 5.1 CONTENTS
Boxxyerrorbars 48
Candlesticks 48
Circles 49
Ellipses 50
Dots 51
Filledcurves 51
Financebars 52
Fsteps 52
Fillsteps 53
Histeps 53
Histograms 53
Newhistogram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Automated iteration over multiple columns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
Image 56
Transparency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
Image pixels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
Impulses 57
Labels 58
Lines 58
Linespoints 59
Parallelaxes 59
Points 59
Polar 60
Steps 60
Rgbalpha 60
Rgbimage 60
Vectors 61
Xerrorbars 61
CONTENTS gnuplot 5.1 5
Xyerrorbars 61
Yerrorbars 62
Xerrorlines 62
Xyerrorlines 63
Yerrorlines 63
3D (surface) plots 63
2D projection (set view map) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
III Commands 65
Cd 65
Call 65
Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
Old-style . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
Clear 66
Do 67
Evaluate 67
Exit 68
Fit 68
Adjustable parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
Short introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
Error estimates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
Statistical overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
Practical guidelines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Control variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Environment variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
Multi-branch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
Starting values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
Tips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
Help 75
History 75
If 76
6 gnuplot 5.1 CONTENTS
If-old . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
For 77
Import 77
Load 77
Lower 78
Pause 78
Plot 79
Axes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
Binary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
Array . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
Record . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
Skip . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
Endian . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
Filetype . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
Avs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
Edf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
Png . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
Keywords . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
Scan . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
Transpose . . . . . . . . . . . . . . . .