Chapter 3. Working with data

 

Working with data is what gnuplot is all about. In this chapter, we look at three blocks of functionality, all of which help us to perform increasingly complicated operations on data. First we look at some special gnuplot syntax to pick out only parts from a larger file—often useful when dealing with data sets that are larger or more complicated than the straightforward ones we’ve considered so far. Then we discuss commands to smooth or otherwise clean up messy data sets. And finally, after taking a quick look at its math capabilities, we introduce gnuplot’s data transformation features, which allow us to perform arbitrary data manipulations when generating a plot. These are particularly useful, and we’ll make use of them many times going forward.

Everything I describe in this chapter is part of the plot command, similar to the using or title directives we’ve encountered before. Actually, there’s even more to the plot command than this: we’ll encounter some additional features in the following chapters on style and coordinate systems (axes). You can check appendix B for a full list of available directives. All directives to the plot command can be used together (potentially leading to long command lines), but they have to occur in proper order. Check the appendix for details.

3.1. Managing large data sets

3.2. Smoothing and summarizing data

3.3. Math with gnuplot

3.4. Data transformations

3.5. Plotting functions and data

3.6. Logarithmic plots

3.7. Summary