Chapter 4. Managing data sets and files


This chapter covers

  • Data-file formats and options
  • Managing structured data sets
  • Accessing columns and pseudocolumns
  • Pseudofiles and input/output redirection
  • Metadata in data files

Working with data is what gnuplot is all about. Data is usually presented to gnuplot as files, and in this chapter you’ll learn a range of useful tricks that can make you more productive when working with gnuplot.

We’ll begin with a review of gnuplot’s standard file format and discuss options to modify its defaults. We’ll then look at some special gnuplot syntax to pick out only parts from larger files. This is required when dealing with data sets that are larger or more complicated than the straightforward ones you’ve encountered so far, and it’s often useful.

Next, we’ll systematically consider all the ways you can access columns—in particular, in conjunction with inline transformations. In the process, you’ll also encounter pseudocolumns, which are synthetic columns that gnuplot automatically provides when reading a file. Pseudocolumns hold useful information (such as line numbers) and often come in handy when you’re constructing inline transformations. Then we’ll turn to files that aren’t: pseudofiles are data sources that don’t live on the disk but that you can treat almost as if they were regular files.

4.1. Quickstart: the standard data-file format

4.2. Managing structured data sets

4.3. File format options in detail

4.4. Accessing columns and pseudocolumns

4.5. Pseudofiles

4.6. Metadata in data files

4.7. Other file formats

4.8. Summary