Nofel Yaseen
Nofel Yaseen

Reputation: 51

How to bold overlapping Points in gnuplot?

Is there a way to bold overlapping points in gnuplot. Example if I have a simple data

1 1
1 1
1 1
2 0.0
2 0.0
2 0.314285714286
2 0.967213114754
2 0.936507936508

1 1 and 2 0.0 are repeating. I want to increase the point size (ps)/bold them depending on the number of times they are repeated.

plot    "file1.txt" title "file 1" pt 7 ps 1 , \
"file2.txt"  title "file 2" pt 7 ps 1

My current plot: enter image description here

Upvotes: 0

Views: 479

Answers (1)

Dan Sp.
Dan Sp.

Reputation: 1447

The command line utility uniq (not in gnuplot) can prefix a line in a file with a count of how many duplicate lines there are. So lets pipe your file through this and use the new 1st column for the point size:

plot '< uniq -c FileName.txt' using 2:3:(0.7+$1*0.3) ps variable

The third element in the using sequence is used by the variable pointsize. The code I put in there will start with a pointsize of 1 and increase by 0.3 for each duplicate data point.

Upvotes: 2

Related Questions