Let me summarize my learnings, I'm a bit confused about ranges, samples and parametric.
What I wanted to achieve is the following:
3 curves with different ranges and different samples by one plot command. For example to illustrate:
- Random: 1000 random points in the range [0:2][0:2]
- Circle: Circle with radius 1 and 24 points in the range [-1:1][-1:1]
- Line: Straight line with 3 samples in the range [-0.5:0.5][-0.5:0.5]
Learnings:
- if
parametric is off, it does not not allow (gives an error) to specify [start:end:step] in the first plot command, whereas it is tolerated in the second and third (sub)plot-command. Strange.
- if
parametric is on, the step in the first plot command will be ignored and number of samples will be defined by the previous set samples. Not so obvious.
- if
parametric is off, I cannot achieve the desired result.
- I have to use
set parametric together with [start:end:step] '+' u ...
Long story short. I can achieve the desired results when coding something like:
set parametric
set samples samples1 # because step1 will be ignored
plot [start1:end1:step1] '+' u (<whatever>):(<whatever>) ti "sub-plot 1", \
[start2:end2:step2] '+' u (<whatever>):(<whatever>) ti "sub-plot 2", \
[start3:end3:step3] '+' u (<whatever>):(<whatever>) ti "sub-plot 3"
The code and graph below show different options with/without parametric and different order of the 3 curves.
Only the bottom row in the graph below shows the desired results.
Code:
### curves with different ranges & samples within one plot command
reset session
set colorsequence classic
Random = "[0:1:0.001] '+' u (2*rand(0)):(2*rand(0)) w p pt 7 ps 0.5 not"
RandomFirst = "[0:1] '+' u (2*rand(0)):(2*rand(0)) w p pt 7 ps 0.5 not"
Circle = "[0:2*pi:pi/12] '+' u (cos($1)):(sin($1)) w lp pt 7 not"
CircleFirst = "[0:2*pi] '+' u (cos($1)):(sin($1)) w lp pt 7 not"
Line = "[-0.5:0.5:0.5] '+' u 1:1 w lp pt 7 lw 2 not"
LineFirst = "[-0.5:0.5] '+' u 1:1 w lp pt 7 lw 2 not"
set multiplot layout 4,3 columnsfirst
set label 1 "random/circle/line" at screen 0.166,0.99 center
unset parametric
set title "parametric OFF"
plot @RandomFirst, @Circle, @Line
set parametric
set title "parametric ON"
plot @Random, @Circle, @Line
unset parametric
set samples 1000
set title "parametric OFF"
plot @RandomFirst, @Circle, @Line
set parametric
set title "parametric ON"
plot @Random, @Circle, @Line
set label 2 "line/random/circle" at screen 0.5,0.99 center
unset parametric
set title "parametric OFF"
plot @LineFirst, @Random, @Circle
set parametric
set title "parametric ON"
plot @Line, @Random, @Circle
set samples 3
unset parametric
set title "parametric OFF"
plot @LineFirst, @Random, @Circle
set parametric
set title "parametric ON"
plot @Line, @Random, @Circle
set label 3 "circle/line/random" at screen 0.833,0.99 center
unset parametric
set title "parametric OFF"
plot @CircleFirst, @Line, @Random,
set parametric
set title "parametric ON"
plot @Circle, @Line, @Random,
set samples 24
unset parametric
set title "parametric OFF"
plot @CircleFirst, @Line, @Random,
set parametric
set title "parametric ON"
plot @Circle, @Line, @Random,
unset multiplot
### end of code
Result:

u 1:1syntax. Then what is the difference betweenplot cos(t),sin(t)andplot '+' u (cos($1)):(sin($1)), except the first one is easier to write and read? The follow-up question would be: is it possible to have different samplings, e.g. first curve 1000 samples, second curve 10 samples? So far, I guess you canset samplesonly before the plot command and it will hold for all curves, right?splot '++' using 1:2:($1*25.*sin($2/10)), [u=30:70:5][v=0:50:2] '++' using 1:2:(u*v)