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 - 2017 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.7 (August 2017) 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 Demos and Online Examples 21 Batch/Interactive Operation 21 Canvas size 22 Command-line-editing 22 Comments 23 Coordinates 23 Datastrings 24 Enhanced text mode 24 Environment 25 Expressions 26 Functions.................................................. 27 Elliptic integrals........................................... 28 Random number generator..................................... 29 Value................................................. 29 Counting and extracting words................................... 29 Operators.................................................. 29 Unary................................................. 30 Binary................................................. 30 Ternary................................................ 31 Summation................................................. 31 Gnuplot-defined variables......................................... 31 User-defined variables and functions................................... 32 CONTENTS gnuplot 5.03 Fonts 33 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........................................... 37 Linecolor variable.......................................... 37 Rgbcolor variable.......................................... 37 Dashtype.................................................. 37 Linestyles vs linetypes........................................... 38 Layers 38 Mouse input 39 Bind..................................................... 39 Bind space.............................................. 40 Mouse variables............................................... 40 Persist 41 Plotting 41 Start-up (initialization) 41 String constants and string variables 42 Substitution and Command line macros 42 Substitution of system commands in backquotes............................ 42 Substitution of string variables as macros................................ 43 String variables, macros, and command line substitution........................ 43 Syntax 44 Quote Marks................................................ 44 Time/Date data 45 II Plotting styles 47 Boxerrorbars 47 Boxes 47 4 gnuplot 5.0 CONTENTS Boxplot 48 Boxxyerrorbars 49 Candlesticks 49 Circles 50 Ellipses 51 Dots 52 Filledcurves 52 Financebars 53 Fsteps 53 Fillsteps 54 Histeps 54 Histograms 54 Newhistogram................................................ 56 Automated iteration over multiple columns............................... 57 Image 57 Transparency................................................ 58 Image pixels................................................. 58 Impulses 58 Labels 59 Lines 60 Linespoints 60 Parallelaxes 60 Points 61 Polar 61 Steps 61 Rgbalpha 61 Rgbimage 61 Vectors 62 CONTENTS gnuplot 5.05 Xerrorbars 62 Xyerrorbars 62 Yerrorbars 63 Xerrorlines 63 Xyerrorlines 64 Yerrorlines 64 3D (surface) plots 64 2D projection (set view map)....................................... 65 III Commands 66 Cd 66 Call 66 Example................................................... 67 Old-style.................................................. 67 Clear 67 Do 68 Evaluate 68 Exit 69 Fit 69 Adjustable parameters........................................... 71 Short introduction............................................. 71 Error estimates............................................... 72 Statistical overview......................................... 72 Practical guidelines......................................... 73 Control................................................... 74 Control variables........................................... 74 Environment variables........................................ 75 Multi-branch................................................ 75 Starting values............................................... 75 Tips..................................................... 76 Help 76 History 77 6 gnuplot 5.0 CONTENTS If 77 If-old..................................................... 77 For 78 Import 78 Load 79 Lower 79 Pause 79 Plot 80 Axes..................................................... 81 Binary.................................................... 81 General................................................ 82 Array................................................. 82 Record................................................ 82 Skip.................................................. 82 Format................................................ 83 Endian................................................ 83 Filetype................................................ 83 Avs............................................. 83 Edf............................................. 83 Png............................................. 83 Keywords............................................... 84 Scan............................................. 84 Transpose.......................................... 84 Dx, dy, dz.......................................... 84 Flipx, flipy, flipz...................................... 84 Origin........................................... 84 Center............................................ 84 Rotate............................................ 84 Perpendicular........................................ 85 Data..................................................... 85 Every................................................. 86 Example datafile........................................... 87 Index................................................. 87 Inline data.............................................. 88 Skip.................................................. 88 Smooth................................................ 89 Acsplines.......................................... 89 Bezier............................................ 89 CONTENTS gnuplot 5.07 Csplines........................................... 89 Mcsplines.......................................... 89 Sbezier........................................... 90 Unique........................................... 90 Unwrap........................................... 90 Frequency.......................................... 90 Cumulative......................................... 90 Cnormal........................................... 90 Kdensity.......................................... 90 Special-filenames........................................... 90 Thru................................................. 92 Using................................................. 92 Using examples....................................... 93 Pseudocolumns....................................... 94 Xticlabels.......................................... 94 X2ticlabels......................................... 95 Yticlabels.......................................... 95 Y2ticlabels......................................... 95 Zticlabels.......................................... 95 Volatile................................................ 95 Errorbars.................................................. 95 Errorlines.................................................. 96 Functions.................................................. 96 Parametric................................................. 96 Ranges.................................................... 97 Sampling.................................................. 98 For loops in plot command........................................ 98 Title..................................................... 99 With..................................................... 100 Print 102 Printerr 102 Pwd 102 Quit 102 Raise 103 Refresh 103 Replot 103 Reread 104 8 gnuplot 5.0 CONTENTS Reset 104 Save 105 Set-show 105 Angles.................................................... 105 Arrow.................................................... 106 Autoscale.................................................. 107 Parametric mode........................................... 108 Polar mode.............................................. 109 Bars..................................................... 109 Bind..................................................... 109 Bmargin................................................... 109 Border...................................................