Gnuplot 5.2 an Interactive Plotting Program Thomas Williams & Colin Kelley
Total Page:16
File Type:pdf, Size:1020Kb
gnuplot 5.2 An Interactive Plotting Program Thomas Williams & Colin Kelley Version 5.2 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, Daniel Sebald, 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 - 2019 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.2.6 (January 2019) 2 gnuplot 5.2 CONTENTS Contents I Gnuplot 18 Copyright 18 Introduction 18 Seeking-assistance 19 New features 20 Features introduced in version 5.2.................................... 20 New plot styles and style options.................................. 20 New data pre-processing filters................................... 20 Polar mode improvements and extensions............................. 20 Nonlinear coordinates systems................................... 20 New commands and command options............................... 21 New data type "array" ....................................... 21 New terminals and terminal options................................ 21 Other new features.......................................... 21 Features introduced in version 5.0.................................... 22 Differences from version 4 22 Deprecated syntax 23 Demos and Online Examples 24 Batch/Interactive Operation 24 Canvas size 24 Command-line-editing 25 Comments 25 Coordinates 25 Datastrings 26 Enhanced text mode 27 Environment 28 Expressions 28 Complex arithmetic............................................ 29 Constants.................................................. 29 Functions.................................................. 29 CONTENTS gnuplot 5.23 Elliptic integrals........................................... 31 Random number generator..................................... 32 Value................................................. 32 Counting and extracting words................................... 32 Operators.................................................. 32 Unary................................................. 32 Binary................................................. 33 Ternary................................................ 34 Summation................................................. 34 Gnuplot-defined variables......................................... 34 User-defined variables and functions................................... 35 Arrays.................................................... 36 Fonts 36 Cairo (pdfcairo, pngcairo, epscairo, wxt terminals)........................... 37 Gd (png, gif, jpeg, sixel terminals).................................... 37 Postscript (also encapsulated postscript *.eps)............................. 37 Glossary 38 Inline data and datablocks 38 Iteration 39 Linetypes, colors, and styles 40 Colorspec.................................................. 40 Background color........................................... 41 Linecolor variable.......................................... 41 Rgbcolor variable.......................................... 41 Dashtype.................................................. 42 Linestyles vs linetypes........................................... 42 Layers 43 Mouse input 43 Bind..................................................... 43 Bind space.............................................. 44 Mouse variables............................................... 45 Persist 45 Plotting 45 Start-up (initialization) 46 String constants and string variables 46 4 gnuplot 5.2 CONTENTS Substitution and Command line macros 47 Substitution of system commands in backquotes............................ 47 Substitution of string variables as macros................................ 47 String variables, macros, and command line substitution........................ 48 Syntax 48 Quote Marks................................................ 49 Time/Date data 49 II Plotting styles 51 Boxerrorbars 51 Boxes 51 Boxplot 52 Boxxyerror 53 Candlesticks 54 Circles 55 Ellipses 55 Dots 56 Filledcurves 56 Fill properties................................................ 57 Financebars 57 Fsteps 58 Fillsteps 58 Histeps 58 Histograms 58 Newhistogram................................................ 60 Automated iteration over multiple columns............................... 61 Image 61 Transparency................................................ 62 Image pixels................................................. 63 Impulses 63 CONTENTS gnuplot 5.25 Labels 63 Lines 64 Linespoints 64 Parallelaxes 65 Points 65 Steps 65 Rgbalpha 66 Rgbimage 66 Vectors 66 Xerrorbars 66 Xyerrorbars 67 Yerrorbars 67 Xerrorlines 68 Xyerrorlines 68 Yerrorlines 68 Zerrorfill 69 3D plots 69 Surface plots................................................ 69 2D projection (set view map)....................................... 70 Polar plots 70 Bee swarm plots 70 Fence plots 70 III Commands 71 Break 71 Cd 71 Call 71 Example................................................... 72 6 gnuplot 5.2 CONTENTS Old-style.................................................. 72 Clear 73 Continue 73 Do 73 Evaluate 73 Exit 74 Fit 74 Adjustable parameters........................................... 76 Short introduction............................................. 77 Error estimates............................................... 78 Statistical overview......................................... 78 Practical guidelines......................................... 79 Control................................................... 79 Control variables........................................... 79 Environment variables........................................ 80 Multi-branch................................................ 80 Starting values............................................... 81 Tips..................................................... 81 Help 82 History 82 If 82 If-old..................................................... 83 For 83 Import 83 Load 84 Lower 84 Pause 84 Plot 85 Axes..................................................... 86 Binary.................................................... 86 General................................................ 87 Array................................................. 87 Record................................................ 87 CONTENTS gnuplot 5.27 Skip.................................................. 87 Format................................................ 88 Endian................................................ 88 Filetype................................................ 88 Avs............................................. 88 Edf............................................. 88 Png............................................. 88 Keywords............................................... 89 Scan............................................. 89 Transpose.......................................... 89 Dx, dy, dz.......................................... 89 Flipx, flipy, flipz...................................... 89 Origin........................................... 89 Center............................................ 89 Rotate............................................ 89 Perpendicular........................................ 90 Data..................................................... 90 Bins.................................................. 91 Every................................................. 92 Example datafile........................................... 92 Index................................................. 93 Skip.................................................. 94 Smooth................................................ 94 Acsplines.......................................... 94 Bezier............................................ 94 Bins............................................. 95 Csplines........................................... 95 Mcsplines.......................................... 95 Sbezier........................................... 95 Unique........................................... 95 Unwrap........................................... 95 Frequency.......................................... 95 Fnormal........................................... 95 Cumulative......................................... 95 Cnormal........................................... 95 Kdensity.......................................... 96 Special-filenames........................................... 96 Piped-data.............................................. 97 Thru................................................. 97 Using................................................. 97 Using examples....................................... 98 Pseudocolumns....................................... 99 8 gnuplot 5.2 CONTENTS Xticlabels.......................................... 99 X2ticlabels......................................... 99 Yticlabels.......................................... 100 Y2ticlabels......................................... 100 Zticlabels.......................................... 100 Volatile................................................ 100 Errorbars.................................................