next up previous contents index
Next: For loops in plot Up: Plot Previous: Ranges   Contents   Index

Sampling

By default, computed functions or data generated for the pseudo-file "+" are sampled over the entire range of the plot. This range may have been specified by a prior set xrange command, by an explicit global range specifier at the very start of the plot command, or by autoscaling of the range to span data seen in all the elements of this plot command. However, individual plot components can be assigned a more restricted sampling range.

Examples:

This establishes a total range on x running from 0 to 1000 and then plots data from a file and two functions each spanning a portion of the total range:

     plot [0:1000] 'datafile', [0:200] func1(x), [200:500] func2(x)

This is similar except that the total range is established by the contents of the data file. In this case the sampled functions may or may not be entirely contained in the plot:

     set autoscale x
     plot 'datafile', [0:200] func1(x), [200:500] func2(x)

This command is ambiguous. The initial range will be interpreted as applying to the entire plot, not solely to the sampling of the first function as was probably the intent:

     plot [0:10] f(x), [10:20] g(x), [20:30] h(x)

This command removes the ambiguity of the previous example by inserting the keyword sample so that the range is not applied to the entire plot:

     plot sample [0:10] f(x), [10:20] g(x), [20:30] h(x)

This example shows one way of tracing out a helix in a 3D plot

     splot [-2:2][-2:2] sample [h=1:10] '+' using (cos(h)):(sin(h)):(h)


next up previous contents index
Next: For loops in plot Up: Plot Previous: Ranges   Contents   Index
2017-02-10