Statistical data is only as valuable as your ability to analyze, interpret, and present it in a meaningful way. Gnuplot is the most widely used program to plot and visualize data for Unix/Linux systems and it is also popular for Windows and the Mac. It's open-source (as in free!), actively maintained, stable, and mature. It can deal with arbitrarily large data sets and is capable of producing high-quality, publication-ready graphics. So far, the only comprehensive documentation available about gnuplot is the online reference documentation, which makes it both hard to get started and almost impossible to get a complete overview over all of its features. If you've never tried gnuplot "or have found it tough to get your arms around "read on. Gnuplot in Action is the first comprehensive introduction to gnuplot "from the basics to the power features and beyond. Besides providing a tutorial on gnuplot itself, it demonstrates how to apply and use gnuplot to extract intelligence from data. Particular attention is paid to tricky or poorly-explained areas. You will learn how to apply gnuplot to actual data analysis problems. This book looks at different types of graphs that can be generated with gnuplot and will discuss when and how to use them to extract actual information from data. One of gnuplot's main advantages is that it requires no programming skills nor knowledge of advanced mathematical or statistical concepts. Gnuplot in Action assumes you have no previous knowledge of either gnuplot or statistics and data analysis. The books starts out with basic gnuplot concepts, then describes in depth how to get a graph ready for final presentation and to make it look "just right" by including arrows, labels, and other decorations. Next the book looks at advanced concepts, such as multi-dimensional graphs and false-color plots "powerful features for special purposes. The author also describes advanced applications of gnuplot, such as how to script gnuplot so that it can run unattended as a batch job, and how to call gnuplot from within a CGI script to generate graphics for dynamic websites on demand. Gnuplot in Action makes gnuplot easy for anyone who needs to do data analysis, but doesn't have an education in analytical tools and methods. It's perfect for DBAs, programmers, and performance engineers; business analysts and MBAs; and Six-Sigma Black Belts and process engineers. What's Inside: * Creating graphs with gnuplot * Data transformations and filters * Preparing/polishing graphs for final presentation * Publishing graphs in print or on the Web * Using gnuplot's power features * Gnuplot scripting and programming * Types of graphs and when to use them * Techniques of graphical analysis * How to build, install, and develop for gnuplot * Command and Option reference organized by concept
Cover......Page 1
Title page......Page 5
Copyright page......Page 6
Brief Contents......Page 9
Contents......Page 11
Foreword......Page 19
Foreword......Page 21
Preface......Page 23
Acknowledgments......Page 25
Contents of this book......Page 27
How to read this book......Page 28
Intended audience......Page 29
Conventions......Page 30
Hardware and software requirements......Page 31
Author online......Page 32
About the cover illustration......Page 33
Part 1 – Basics......Page 35
1 Prelude: Understanding data with gnuplot......Page 37
1.1.1 Planning a marathon......Page 38
1.1.2 Determining the future......Page 40
1.2 What is graphical analysis?......Page 43
1.2.1 Data analysis and visualization concepts......Page 44
1.2.3 Limitations of graphical analysis......Page 46
1.3.1 Gnuplot isn’t GNU......Page 47
1.3.2 Why gnuplot?......Page 48
1.4 Summary......Page 49
2.1 Simple plots......Page 50
2.1.1 Invoking gnuplot and first plots......Page 51
2.1.2 Plotting data from a file......Page 54
2.1.3 Abbreviations and defaults......Page 57
2.2 Saving and exporting......Page 58
2.2.2 Exporting graphs......Page 59
2.2.3 One-step export script......Page 61
2.3 Summary......Page 62
3 Working with data......Page 63
3.1.1 Multiple data sets per file: index......Page 64
3.1.2 Records spanning multiple lines: every......Page 65
3.2.1 Plotting unsorted data files......Page 66
3.2.2 Smoothing noisy data......Page 69
3.3.2 Built-in functions......Page 72
3.3.3 User-defined variables and functions......Page 73
3.3.4 Complex numbers......Page 74
3.4.1 Simple data transformations......Page 75
3.4.2 Pseudocolumns and the column function......Page 76
3.5 Plotting functions and data......Page 77
3.6.1 How do logarithmic plots work?......Page 78
3.7 Summary......Page 81
4 Practical matters......Page 83
4.1 Managing options......Page 84
Number Formats......Page 85
Missing Values......Page 86
More Tricks with Data Files......Page 88
4.3.2 String operations......Page 89
4.3.3 String applications......Page 91
4.3.4 Crazy example: plotting the Unix password file......Page 92
4.4.1 The print command......Page 93
4.4.2 The set table option......Page 94
4.5.2 Command history......Page 95
Hot Keys......Page 96
4.5.4 Reading data interactively......Page 97
4.6 Summary......Page 98
Part 2 – Polishing......Page 99
5 Doing it with style......Page 101
5.1.1 Inline style directives......Page 102
5.1.2 Terminal capabilities......Page 103
5.2 Plot styles......Page 104
Lines and Linespoints......Page 105
Steps......Page 106
Boxes and Impulses......Page 107
Histograms......Page 108
Styles with Errorbars......Page 112
Time Series Styles......Page 114
5.2.4 Filled styles......Page 115
5.2.5 Other styles......Page 118
5.3 Customizing styles......Page 119
5.3.1 Custom line styles......Page 120
5.3.3 Worked example: half-tone shading......Page 121
5.4 Summary......Page 123
6 Decorations......Page 124
6.1 Quick start: minimal context for data......Page 125
6.2 Digression: locations on a graph......Page 126
6.3.2 Arrows......Page 128
Customizing Arrow Appearance......Page 129
More Tricks with Arrows......Page 130
6.3.3 Text labels......Page 131
Axis Labels......Page 132
6.3.4 Objects......Page 133
6.4 The graph’s legend or key......Page 134
6.4.3 Layout......Page 135
Taking Explanations from the Data File......Page 136
6.5 Worked example: features of a spectrum......Page 138
6.6.1 Size and aspect ratio......Page 140
6.6.2 Borders and margins......Page 142
6.7 Summary......Page 143
7 All about axes......Page 144
7.1.1 Terminology......Page 145
7.1.2 Plotting with two coordinate systems......Page 146
7.1.3 Should you do it?......Page 147
7.2 Selecting plot ranges......Page 149
7.3.1 Major tic marks......Page 150
7.3.2 Minor tic marks......Page 151
7.3.3 Formatting the tic labels......Page 152
7.3.4 Reading tic labels from file......Page 156
7.4 A worked example......Page 157
7.5.1 Turning numbers into names: months and weekdays......Page 158
7.5.2 General time series: the gory details......Page 161
Input......Page 162
Working in Time Series Mode......Page 163
7.6 Summary......Page 164
Part 3 – Advanced Gnuplot......Page 165
8 Three-dimensional plots......Page 167
8.1 Basics......Page 169
8.2.1 Surface plots......Page 170
8.2.2 Contour lines......Page 173
8.3 Coordinate axes and view point......Page 175
8.3.1 Borders......Page 176
8.3.2 View point......Page 177
8.4 Plotting data from a file using splot......Page 179
8.4.1 Grid format......Page 180
8.4.2 Matrix format......Page 182
8.4.3 Smooth surfaces......Page 183
8.5 Summary......Page 185
9 Color......Page 186
9.1.1 Color spaces: a refresher......Page 187
Creating Palettes by Interpolating Between Individual Colors......Page 188
Creating Palettes with Functions......Page 189
Querying and Testing Palettes......Page 190
9.2.1 The pm3d mode......Page 191
9.2.2 The colorbox......Page 192
9.2.3 Other ways to use color......Page 194
9.3 Using color for data representation......Page 195
9.3.1 Thoughts on palette design......Page 196
9.3.2 Some sample palettes......Page 199
9.3.3 Words of caution......Page 202
9.4.1 A smoothly varying function......Page 207
9.4.2 A complex figure......Page 209
9.5 Summary......Page 211
10 Advanced plotting concepts......Page 213
10.1 Multiplot......Page 214
10.1.1 Regular arrays of graphs with layout......Page 215
10.1.2 Graphs within a graph......Page 217
10.1.3 Graphs aligned on a common axis......Page 219
10.2.1 Parametric plots......Page 221
10.2.2 Non-Cartesian coordinates......Page 222
10.2.3 Vector fields......Page 226
10.3.1 Background......Page 228
10.3.2 Using the fit command......Page 229
Control Variables and Output Variables......Page 231
Practical Advice......Page 232
10.3.3 Worked example......Page 233
10.3.4 Should you do it?......Page 235
10.4 Summary......Page 237
11 Terminals in depth......Page 238
11.1 Exporting graphs to file......Page 239
11.2.3 Enhanced text mode......Page 240
11.2.5 Flushing output channels......Page 243
11.3.1 Bitmaps......Page 244
PNG......Page 245
11.3.2 SVG......Page 246
11.4.1 PostScript......Page 247
Including an EPS File in a LaTeX Document......Page 249
Using the epslatex Terminal......Page 250
11.4.3 PDF......Page 255
11.5.1 wxt......Page 256
11.5.4 windows......Page 257
11.6 Other terminals......Page 258
11.7 Summary......Page 259
12 Macros, scripting, and batch operations......Page 260
12.1 Strings and string macros......Page 261
12.2 Calling other programs from gnuplot......Page 262
12.2.2 Capturing the output of a subprocess......Page 263
12.2.3 Input / output redirection (Unix only)......Page 264
12.2.4 Example: watermarking plots......Page 265
12.3.1 Batch operations......Page 266
12.3.2 Invoking gnuplot from other programs......Page 267
12.4 Slideshows with pause and reread......Page 270
12.5 Configuring your workspace......Page 272
12.5.1 Creating custom hot key bindings......Page 274
12.6.1 Using Gnuplot as a CGI script......Page 277
12.7 Summary......Page 279
Part 4 – Graphical Analysis with Gnuplot......Page 281
13 Fundamental graphical methods......Page 283
An Example: Car Data......Page 284
Using Scatter Plots......Page 285
A More Complicated Example: The 1970 Draft Lottery......Page 286
A Note on Splines......Page 287
Scatter Plots with Labels: Car Data, Again......Page 289
13.1.2 Logarithmic scales......Page 290
13.2.1 Jitter plots and histograms......Page 294
13.2.2 Kernel density estimates......Page 296
13.2.3 Cumulative distribution functions......Page 297
13.2.4 Consider using median and percentiles......Page 299
13.3 Ranked data......Page 300
13.4.1 Parallel coordinate plots......Page 302
13.4.2 Multivariate analysis......Page 307
13.4.3 Star plots......Page 308
13.4.4 Historical perspective: computer-aided data analysis......Page 309
13.5 Summary......Page 310
14 Techniques of graphical analysis......Page 311
14.1 The core principle of graphical analysis......Page 312
14.2.1 A case study in iteration: car data......Page 313
14.2.2 Making data comparable: monitoring quantities in a control chart......Page 316
14.2.3 Honor the data: truncation and responsiveness......Page 318
14.3.1 Banking......Page 322
14.3.2 Judging lengths and distances......Page 325
14.3.3 Enhancing quantitative perception......Page 327
14.3.4 Plot ranges and the matter of zero......Page 329
14.3.5 A tough problem: the display of changing compositions......Page 330
14.4.2 Input data files......Page 334
14.5 Reminders for presentation graphics......Page 336
14.6 Summary......Page 338
15 Coda: Understanding data with graphs......Page 339
A.1 Release and development versions......Page 341
A.2.3 Windows......Page 342
A.3.1 Obtaining the development version from CVS......Page 343
A.3.3 Building and installing......Page 344
Configure......Page 345
Mac Os X......Page 346
B.1.1 Running gnuplot......Page 347
B.1.4 Plotting......Page 348
B.1.5 Managing options......Page 350
B.1.7 Terminal handling......Page 351
B.1.8 Curve fitting......Page 352
B.1.9 Miscellaneous......Page 353
B.2.3 Hyperbolic functions......Page 354
B.2.6 Gamma function and related functions......Page 355
B.2.9 String functions!!......Page 356
B.2.11 Time column handling functions!......Page 357
B.3.2 Binary operators......Page 358
B.4.1 Configuration......Page 359
B.4.2 Math......Page 361
B.4.3 Appearance......Page 362
B.4.4 Decorations......Page 364
B.4.5 Style......Page 366
B.4.6 Axes......Page 369
B.4.7 Three-dimensional plots......Page 373
Contour Plots......Page 374
Color Plots (pm3d Mode)......Page 375
B.4.8 Output......Page 376
Enhanced Text Mode......Page 377
Symbol Font......Page 378
Postscript Terminals......Page 380
Interactive Terminals......Page 381
Misc......Page 382
C.2.1 Graphics and graphical analysis......Page 383
C.2.2 Statistics......Page 384
C.3 Other open source tools......Page 385
C.3.2 Graphing tools......Page 386
B......Page 388
C......Page 389
E......Page 390
G......Page 391
K......Page 392
O......Page 393
P......Page 394
R......Page 395
T......Page 396
W......Page 397
Z......Page 398