concept output in category gnuplot

appears as: output, output
Gnuplot in Action

This is an excerpt from Manning's book Gnuplot in Action.

But to export a graph to a file, you need to employ a file-based terminal that can generate output in the desired output format (PNG, PDF, SVG, and so on). Most file-based terminals accept a large number of options through which you can control various aspects (such as the size) of the resulting graph. These options are covered in detail in chapter 10.

set terminal pngcairo
set output "| convert - graph.gif"
plot sin(x)
set output
Figure 10.2. Output produced when various free fonts are requested on my computer—your version may look different. The first part of the test string contains a selection of characteristic regular characters, and the second part consists of common mathematical symbols and Greek letters.
Gnuplot in Action: Understanding Data with Graphs

This is an excerpt from Manning's book Gnuplot in Action: Understanding Data with Graphs.

Listing 2.2. The complete workflow to generate a PNG file from gnuplot

This example demonstrates an important point: after exporting to a file, gnuplot does not automatically revert back to interactive mode—instead, all further output will be directed to the specified file. Therefore, we need to explicitly restore the interactive terminal (x11 in this example) and the output device. (The command set output without an argument sends all output to the interactive device, usually the screen.) This should come as no surprise. As we’ve seen before, gnuplot remembers any previous settings, and so neither the terminal nor the output setting change until we explicitly assign them a different value.

Figure 10.10. A noisy data set and a best fit curve. See listing 10.8 for the output of the fit command.
Listing 12.1. Script to export a plot to a PNG file with a watermark

In general, the system() function is more versatile than back ticks, and the preferred way to capture output from a subprocess. But back ticks have the advantage that they can occur inside of double-quoted strings, whereas the output from the system() function would have to be concatenated explicitly to the string. In other words, the following two commands are equivalent:

sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage
test yourself with a liveTest