Gnuplot Documentation and Sources
Total Page:16
File Type:pdf, Size:1020Kb
gnuplot 5.0 An Interactive Plotting Program Thomas Williams & Colin Kelley Version 5.0 organized by: Ethan A Merritt and many others Major contributors (alphabetic order): Christoph Bersch, Hans-Bernhard Br¨oker, John Campbell, Robert Cunningham, David Denholm, Gershon Elber, Roger Fearick, Carsten Grammes, Lucas Hart, Lars Hecking, P´eterJuh´asz, Thomas Koenig, David Kotz, Ed Kubaitis, Russell Lang, Timoth´eeLecomte, Alexander Lehmann, J´er^omeLodewyck, Alexander Mai, Bastian M¨arkisch, Ethan A Merritt, Petr Mikul´ık, Carsten Steger, Shigeharu Takeno, Tom Tkacik, Jos Van der Woude, James R. Van Zandt, Alex Woo, Johannes Zellner Copyright c 1986 - 1993, 1998, 2004 Thomas Williams, Colin Kelley Copyright c 2004 - 2015 various authors Mailing list for comments: [email protected] Mailing list for bug reports: [email protected] Web access (preferred): http://sourceforge.net/projects/gnuplot This manual was originally prepared by Dick Crawford. Version 5.0.2 (January 2016) 2 gnuplot 5.0 CONTENTS Contents I Gnuplot 17 Copyright 17 Introduction 17 Seeking-assistance 18 New features in version 5 19 New commands............................................... 20 Changes in version 5 20 Deprecated syntax 21 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 Counting and extracting words................................... 29 Operators.................................................. 29 Unary................................................. 29 Binary................................................. 30 Ternary................................................ 30 Summation................................................. 31 Gnuplot-defined variables......................................... 31 User-defined variables and functions................................... 32 Fonts 33 CONTENTS gnuplot 5.03 Cairo (pdfcairo, pngcairo, epscairo, wxt terminals)........................... 33 Gd (png, gif, jpeg terminals)....................................... 33 Postscript (also encapsulated postscript *.eps)............................. 34 Glossary 34 Iteration 35 Linetypes, colors, and styles 35 Colorspec.................................................. 36 Background color........................................... 36 Linecolor variable.......................................... 37 Rgbcolor variable.......................................... 37 Dashtype.................................................. 37 Linestyles vs linetypes........................................... 38 Layers 38 Mouse input 38 Bind..................................................... 39 Bind space.............................................. 40 Mouse variables............................................... 40 Persist 40 Plotting 41 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 44 Quote Marks................................................ 44 Time/Date data 45 II Plotting styles 46 Boxerrorbars 46 Boxes 46 4 gnuplot 5.0 CONTENTS Boxplot 47 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 CONTENTS gnuplot 5.05 Xerrorbars 61 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..................................................... 75 Help 75 History 76 6 gnuplot 5.0 CONTENTS If 76 If-old..................................................... 76 For 77 Import 77 Load 78 Lower 78 Pause 78 Plot 79 Axes..................................................... 80 Binary.................................................... 80 General................................................ 81 Array................................................. 81 Record................................................ 81 Skip.................................................. 81 Format................................................ 82 Endian................................................ 82 Filetype................................................ 82 Avs............................................. 82 Edf............................................. 82 Png............................................. 82 Keywords............................................... 83 Scan............................................. 83 Transpose.......................................... 83 Dx, dy, dz.......................................... 83 Flipx, flipy, flipz...................................... 83 Origin........................................... 83 Center............................................ 83 Rotate............................................ 83 Perpendicular........................................ 84 Data..................................................... 84 Every................................................. 85 Example datafile........................................... 86 Index................................................. 86 Inline data.............................................. 87 Skip.................................................. 87 Smooth................................................ 88 Acsplines.......................................... 88 Bezier............................................ 88 CONTENTS gnuplot 5.07 Csplines........................................... 88 Mcsplines.......................................... 88 Sbezier........................................... 89 Unique........................................... 89 Unwrap........................................... 89 Frequency.......................................... 89 Cumulative......................................... 89 Cnormal........................................... 89 Kdensity.......................................... 89 Special-filenames........................................... 89 Thru................................................. 91 Using................................................. 91 Using examples....................................... 92 Pseudocolumns....................................... 93 Xticlabels.......................................... 93 X2ticlabels......................................... 94 Yticlabels.......................................... 94 Y2ticlabels......................................... 94 Zticlabels.......................................... 94 Volatile................................................ 94 Errorbars.................................................. 94 Errorlines.................................................. 95 Functions.................................................. 95 Parametric................................................. 95 Ranges.................................................... 96 Sampling.................................................. 97 For loops in plot command........................................ 97 Title..................................................... 98 With..................................................... 99 Print 101 Printerr 101 Pwd 101 Quit 101 Raise 101 Refresh 102 Replot 102 Reread 102 8 gnuplot 5.0 CONTENTS Reset 103 Save 103 Set-show 104 Angles.................................................... 104 Arrow.................................................... 105 Autoscale.................................................. 106 Parametric mode........................................... 107 Polar mode.............................................. 108 Bars..................................................... 108 Bind..................................................... 108 Bmargin................................................... 108 Border.................................................... 108 Boxwidth.................................................