Credits Overview Plotting Styles Commands Terminals

Example: parametric marks

Syntax:

     set mark <tag> [start:end:increment] '+' using (f($1)):(g($1))

figure_parametric_marks

The syntax for the set mark command follows that of a plot command. Thus as an alternative to reading x/y coordinates from a file, array, or data block, a mark can be defined by a pair of parametric equations operating on a sampled implicit variable indicated by the pseudofile '+'. See special_filenames.

This example defines a set of parametric marks and shows how they can be combined with stroke and fill styles to produce a family of plot symbols. This example is a subset of mark_formulas.dem

     set angle degrees
     set mark 1 [t=0:360:10]  '+' using (sin(t)):(cos(t)) ### circle
     set mark 2 [t=0:360:120] '+' using (sin(t)):(cos(t)) ### triangle
     set mark 3 [t=0:360:90]  '+' using (sin(t)):(cos(t)) ### diamond
     set mark 4 [t=0:360:72]  '+' using (sin(t)):(cos(t)) ### pentagon
     set mark 5 [t=0:360:60]  '+' using (sin(t)):(cos(t)) ### hexagon
     set mark 6 [t=0:360:10]  '+' using (cos(t)):(0.8*(sqrt(abs(cos(t)))+sin(t)))          ### heart
     set mark 7 [t=0:360:10]  '+' using (r=0.5*abs(cos(3/2.0*t))+0.5, r*sin(t)):(r*cos(t)) ### 3 petals
     set mark 8 [t=0:360:72/2]  '+' using (r=0.4*(cos(5*t)+2), r*sin(t)):(r*cos(t))        ### star
     set mark 9 [t=0:360:72/20] '+' using (r=0.18*(cos(5*t)+5), r*sin(t)):(r*cos(t))       ### 5 petals
     unset angle
     
     array dummy[1]
     S = 1.25       # scale factor
     plot \
       for [k=1:9] dummy using (k):(11):(sprintf("%i",k)) with labels center,                 \
       for [k=1:9] dummy using (k):(9) with marks mt k ps S fill solid 0.5 border lc 'black', \
       for [k=1:9] dummy using (k):(7) with marks mt k ps S fill solid (1./k)     fc 'black', \
       for [k=1:9] dummy using (k):(5) with marks mt k ps S fill solid 0.0 border lc 'black', \
       for [k=1:9] dummy using (k):(3) with marks mt k ps S fill solid 1.0 noborder fc 'red', \
       for [k=1:9] dummy using (k):(1) with marks mt k ps S fill solid 1.0 border lc 'blue',  \