简体   繁体   中英

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: 在此处输入图片说明

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM