Gnuplot: point size units

How to set point size in gnuplot in coordinate units?

In other words, the points should decrease if I increase xrange.

It seems like it all depends on the terminal. Is there any workaround?

+3
source share
2 answers

Here is a small example of using embedded data ...

plot '-' u 1:2:1 ps variable
  1 2
  2 3
  3 4
  4 5
  5 6
  e

Note that although you can change pointize using a column from your data file, I don’t know which way to indicate how large each point is, since pointize (and even pointtype) is a terminal-dependent value. The only workaround I can come up with is to scale the points to a terminal dependent value.

default_value=1.0
func(x)=1.0*x  #Change this to change the functional dependence of the pointsize on x.
scale_point(x)=(GPVAL_TERM=="postscript") ? 1.0*func(x) :\
               (GPVAL_TERM=="png") ?        2.0*(x) :\
               default_value
plot "mydata.dat" u 1:2:(scale_point($1)) w pt ps variable

, . , , .

, , x , , , . , , , " ". , - ..

2

, gnuplot, .

set style fill transparent solid noborder  #whatever fillstyle you want...
plot 'mydata' u 1:2:3 w circles

. help circles... , , , gnuplot 4.3, 4.2, , ...

+3

, , pointize xrange. , , . , .

pointize.

sps(a,b) = 1./(b-a)

xrange:

set xrange [0:3]

, :

plot sin(X)

, gnuplot.

plot sin(x) with points pt 7 ps sps(GPVAL_X_MIN, GPVAL_X_MAX)

reset xrange , , pointize, xrange. , pointize, "sps", . , - , .

0

All Articles