concept error bar in category gnuplot

appears as: error bars, error bars, error bar
Gnuplot in Action

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

Different types of data call for different display styles. For instance, it makes sense to plot a smooth function with one continuous line but use separate symbols for a sparse data set in which each individual point counts. Experimental data often requires error bars together with the data, whereas counts of discrete events call for histograms. Choosing an appropriate style for the data leads to graphs that are both informative and aesthetically pleasing.

6.3.2. Indicating uncertainty: styles with error bars or ranges

Sometimes you don’t just want to show a single data point; you also want to indicate a range with it. This may be the experimental uncertainty (the error bar), or it may be the range over which some quantity has changed during the observation interval (this is typical of financial charts). Gnuplot offers several styles that place an indicator for such a range onto the plot. First we’ll look at styles that draw regular error bars (both in vertical and in horizontal directions). Then we’ll go on to discuss styles that let you indicate several ranges at once (but only in the vertical direction).

Styles with error bars

There are two basic styles to show data with error bars in gnuplot: errorbars and errorlines (see figure 6.4). The errorlines style is similar to the linespoints style (a symbol for each data point, adjacent points connected by straight lines), whereas the errorbars style is similar to the points style (unconnected symbols).

Figure 6.4. Different plot styles showing uncertainty in the data. From top to bottom: connected symbols using errorlines, unconnected symbols using errorbars, ranges indicated as boxes using boxxyerrorbars, and errors on top of a histogram using boxerrorbars.

These styles draw error bars in addition to the data. Error bars can be drawn in either the x or y direction or both. To select a direction, prefix the style with x, y, or xy, respectively, as in plot "data" with xyerrorlines. Table 6.2 summarizes all available combinations.

Table 6.2. All possible combinations of errorbars and errorlines styles
 

Error bars in x direction

Error bars in y direction

Error bars in both directions

Unconnected symbols xerrorbars yerrorbars xyerrorbars
Connected symbols xerrorlines yerrorlines xyerrorlines

The appearance of both the errorlines and errorbars styles is determined by the current line style. Both styles draw a symbol at the location of the data point—which is unnecessary, because the intersection of the error bars already indicates this position! You can suppress the symbol by specifying pointtype 0, like so: plot "data" u 1:2:3 with yerrorlines pt 0.

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