Gnuplot in Action, Second Edition
eBook - ePub

Gnuplot in Action, Second Edition

Philipp K. Janert

Share book
  1. English
  2. ePUB (mobile friendly)
  3. Available on iOS & Android
eBook - ePub

Gnuplot in Action, Second Edition

Philipp K. Janert

Book details
Book preview
Table of contents
Citations

About This Book

Gnuplot in Action, Second Edition is a major revision of this popular and authoritative guide for developers, engineers, and scientists who want to learn and use gnuplot effectively. Fully updated for gnuplot version 5, the book includes four pages of color illustrations and four bonus appendixes available in the eBook.

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is Gnuplot in Action, Second Edition an online PDF/ePUB?
Yes, you can access Gnuplot in Action, Second Edition by Philipp K. Janert in PDF and/or ePUB format, as well as other popular books in Computer Science & Data Modelling & Design. We have over one million books available in our catalogue for you to explore.

Information

Part 1. Getting started

Gnuplot is a tool for visualizing data and mathematical functions. The chapters in this first part will give a first introduction to gnuplot and its most important features. Chapter 1 introduces gnuplot and describes the kinds of problems it’s designed to solve. Chapter 2 provides a quick tutorial to gnuplot. By the end of this chapter, you’ll be able to prepare simple plots with gnuplot and to save and export your work. Chapter 3 takes a detailed look at the all-important plot command, which is used to generate most graphs in gnuplot. You’ll also learn about inline transformations and built-in smoothing methods.

Chapter 1. Prelude: understanding data with gnuplot

This chapter covers
  • Warmup examples
  • What is graphical analysis?
  • What is gnuplot?
Note to Print Book Readers
Some material of a more specialized nature is only available in the e-book version of this book. The e-book also shows all the graphs in color. To get your free e-book in PDF, ePub, or Kindle format, go to www.manning.com/books/gnuplot-in-action-second-edition to register your print book.
Gnuplot has long been one of the most popular open source programs for plotting and visualizing data. In this book, I want to show you how to use gnuplot to make plots and graphs of your data: both quick and easy graphs for your own use and highly polished graphs for presentations and publications.
But I also want to show you something else: how to solve data-analysis problems using graphical methods. The art of discovering relationships in data and extracting information from it by visual means is called graphical analysis, and I believe gnuplot to be an excellent tool for it.
As a teaser, let’s look at some problems and how you might be able to approach them using graphical methods. The graphs here and in the rest of the book (with very few exceptions) have been, of course, generated with gnuplot.

1.1. A busy weekend

To get a feeling for the kinds of problems you may be dealing with and for the kinds of solutions gnuplot can help you find, let’s look at two examples. Both take place during a long, busy weekend.

1.1.1. Planning a marathon

Imagine you’re in charge of organizing the local city marathon. There will be more than 2,000 starters, traffic closed around the city, plenty of spectators—and a major Finish Line Festival to celebrate the victors. The big question is: when should the Finish Line crew be ready to deal with the majority of runners? At what point do you expect the big influx of the masses?
You have the results from last year’s event. Assuming that the starters haven’t improved dramatically over the last year (probably a safe assumption), you do a quick average of the completion times and find that last year’s average was 282 minutes. To be on the safe side, you calculate the standard deviation as well, which comes out to about 50 minutes. So you tell your crew to be ready for the big rush starting three and a half hours (210 minutes) after the start, and you feel reasonably well prepared for the event.
So it comes as a surprise when on the big day, plenty of runners start showing up at the finish line after only two hours—a good 90 minutes earlier than the expected onset of the rush. In terms of event management, the number of runners who show up early isn’t overwhelming, but it’s a bit strange. The next day you wonder: what went wrong?
Let’s look at the data to see what you can learn about it. So far, all you know are the mean and the standard deviation.
The mean is convenient: it’s easy to calculate, and it summarizes the entire data set in a single number. But in forming the mean, you lost a lot of information. To understand the entire data set, you have to look at it. And because you can’t understand data by looking at more than 2,000 individual finish times, this means you have to plot it.
It will be convenient to group the runners by completion time and to count the number of participants who finished during each five-minute interval. The resulting file might start like this:
# Minutes Runners 135 1 140 2 145 4 150 7 155 11 160 13 165 35 170 29 ...
Now you plot the number of runners against the completion time (see figure 1.1). It’s immediately obvious where you went wrong: the data is bimodal, meaning it has two peaks. There is an early peak at around 180 minutes and a later main peak at 300 minutes.
Figure 1.1. Number of finishers vs. time to complete (in minutes)
Actually, this makes sense: a major sporting event such as a city marathon attracts two very different groups of people: athletes, who train and compete throughout the year and are in it to win, and a much larger group of amateurs, who come out once a year for a big event and are mostly there to participate. The problem is that for such data, the mean and standard deviation are obviously bad representations—so much so. that at the time when you expected the big rush (200 minutes), there’s a lull at the finish line!
The take-home message here is that it’s usually not a good idea to rely on summary statistics (such as the mean) for unknown data sets. You always should investigate what the data looks like. Once you’ve confirmed the basic shape, you can choose how to summarize your findings best.
And of course, there is always more to learn. In this example, for instance, you see that after about 400 minutes, almost everybody has made it, and you can start winding down the operation. The actual “tail” of the distribution is quite small—surprisingly so. (I would’...

Table of contents