Search code examples
gnuplottransparentpointscatter

How to make scatter plots with semitransparent points in Gnuplot?


How can I plot an image with partially transparent scatter points, just like in the picture below, with Gnuplot? The problem is that I don’t know how to set the points to be transparent.

A scatter plot example


Solution

  • Try this:

    set style fill  transparent solid 0.35 noborder
    set style circle radius 0.02
    plot 'test' u 1:2 with circles lc rgb "blue", \
         '' u 1:2 every 100 w circles lc rgb "red" fs solid 1.0 border lt -1
    

    which outputs enter image description here

    As you can see, you can specify for each data set whether to use transparency and which color to use.
    If your data consist of two values (x and y position of the circle) you have to specify the circle's radius via set style circle .... If your data has three rows, you can use the third value to specify the circle's radius for each data point.
    You can play with the transparency level, which ranges from 0 (full transparency) to 1 (no transparency).