4.1.5 Plotting Functions with Errorbars, Arrows, or More

In Gnuplot, when a function (as opposed to a data file) is plotted, only those plot styles which accept two columns of data can be used – for example, lines or points. This means that it is not possible to plot a function with errorbars. In PyXPlot, this is possible using the following syntax:

plot f(x):g(x) with yerrorbars

Two functions are supplied, separated by a colon; plotting proceeds as if a data file had been supplied, containing values of $x$ in column 1, values of $f(x)$ in column 2, and values of $g(x)$ in column 3. This may be useful, for example, if $g(x)$ measures the intrinsic uncertainty in $f(x)$. The using modifier may also be used:

plot f(x):g(x) using 2:3

Here, $g(x)$ would be plotted on the $y$-axis, against $f(x)$ on the $x$-axis. It should be noted, however, that the range of values of $x$ used would still correspond to the range of the plot’s horizontal axis. If the above were to be attempted with an autoscaling horizontal axis, the result might be rather unexpected – PyXPlot would find itself autoscaling the $x$-axis range to the spread of values of $f(x)$, but find that this itself changed depending upon the range of the $x$-axis.1

Footnotes

  1. We’re aware that this is not good. Expect it to change in a future release.