60

How to change point size and shape and color in gnuplot.

plot "./points.dat" using 1:2 title with dots

I am using above command to plot graph ,but it shows very small size points.

I tried to use command

set pointsize 20

but still point size is same.

white_gecko
  • 4,808
  • 4
  • 55
  • 76
user69910
  • 971
  • 2
  • 9
  • 14

3 Answers3

81

Use the pointtype and pointsize options, e.g.

plot "./points.dat" using 1:2 pt 7 ps 10  

where pt 7 gives you a filled circle and ps 10 is the size.

See: Plotting data.

kenorb
  • 155,785
  • 88
  • 678
  • 743
Schorsch
  • 7,761
  • 6
  • 39
  • 65
  • Is there a simple way to specify pointsize in pixels? If the answer is complicated, just say no and I'll make a separate question. – Jared Beck Oct 23 '14 at 03:23
  • @JaredBeck sorry, I don't have a quick answer. You probably stand a better chance with a new questions. – Schorsch Oct 23 '14 at 15:32
  • 1
    Can we change the default point size for all plots without having to specify it for each one individually? – Tarek Jun 09 '16 at 11:13
  • 2
    @Tarek - see [this answer to: How to set a line style as default for multiple plots in Gnuplot](http://stackoverflow.com/a/14924457/2043505). – Schorsch Jun 09 '16 at 11:41
  • It seems that `ps` has no effect when the point type is a character like `"X"`. For example both `pt "X" ps 10` and `pt "X" ps 100` plot the same point size. – builder-7000 Mar 13 '20 at 19:56
8

The pointsize command scales the size of points, but does not affect the size of dots.

In other words, plot ... with points ps 2 will generate points of twice the normal size, but for plot ... with dots ps 2 the "ps 2" part is ignored.

You could use circular points (pt 7), which look just like dots.

Josh Milthorpe
  • 956
  • 1
  • 14
  • 27
0

plot "./points.dat" using 1:2 title with dt 2 lw 4