Chapter 2. Essential gnuplot

 

This chapter covers

  • Invoking gnuplot
  • Plotting functions and data
  • Saving and exporting

In this chapter, we introduce gnuplot’s most important features: generating plots, saving them to a file, and exporting graphs to common graphics file formats. In the next chapter, we’ll talk about data transformations and the organization of data sets. By the end of the next chapter, you’ll know most of the commands you’ll use on a day-to-day basis.

Are you surprised that a couple of chapters are sufficient to get us this far? Congratulations, you just discovered why gnuplot is cool: it makes easy things easy, and hard things possible. This chapter and the next cover the easy parts; as to the hard parts... well, that’s what the rest of this book is all about.

2.1. Simple plots

Since gnuplot is a plotting program, it should come as no surprise that the most important gnuplot command is plot. It can be used to plot both functions (such as sin(x)) and data (typically from a file). The plot command has a variety of options and subcommands, through which we can control the appearance of the graph as well as the interpretation of the data in the file. The plot command can even perform arbitrary transformations on the data as we plot it.

2.1.1. Invoking gnuplot and first plots

2.2. Saving and exporting

 
 

2.3. Summary

 
 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage