PyXPlot can also plot datasets which can be parameterised in terms of two free parameters and
. This is most often useful in conjunction with the surface plot style, allowing any
-surface to be plotted. However, it also works in conjunction with any other plot style, allowing, for example,
-grids of points to be constructed.
As in the case of parametric lines above, the range of values that each free parameter should take must be specified. This can be done using the set urange and set vrange commands. These commands also act to switch PyXPlot between one- and two-dimensional parametric function evaluation; whilst the set trange command indicates that the next parametric function should be evaluated along a single raster of values of , the set urange and set vrange commands indicate that a grid of
values should be used. By default, the range of values used for
and
is
.
The number of samples to be taken can be specified using a command of the form
set sample grid 20x50
which specifies that 20 different values of and 50 different values of
should be used, yielding a total of 1000 datapoints. The following example uses the lines plot style to generate a sequence of cross-sections through a two-dimensional Gaussian surface:
set sample grid 20x20 set urange [-1:1] set vrange [-1:1] f(u,v) = 0.4*exp(-(u**2+v**2)/0.2) plot parametric u:v+f(u,v) with l
The ranges of values to use for and
may alternatively be specified on a dataset-by-dataset basis within the plot command, as in the example
plot parametric [0:1][0:1] u:v , \ parametric [0:1] sin(t):cos(t)
Torus.
In this example we plot a torus, which can be parametrised in terms of two free parameters
where |
||||||||||||||||||
R = 3 set urange [0:2*pi] set nokey |
||||||||||||||||||
![]() |
||||||||||||||||||
Trefoil knot.
In this example we plot a trefoil knot, which is the simplest non-trivial knot in topology. Simply put, this means that it is not possible to untie the knot without cutting it. The knot follows the line
but in this example we construct a tube around this line using the following parameterisation:
where |
||||||||||||||||||||||||||||||||||||
R = 2 set urange [0:2*pi] set nokey |
||||||||||||||||||||||||||||||||||||
![]() |
||||||||||||||||||||||||||||||||||||