3

I am running the following command to draw a few X,Y points in gnuplot:

plot "Output.tsv" using ($2+3):($3+3):1 with labels, "Output.tsv" using 2:3

Some of the data points are very close to each other and it makes the label unreadable. Is there a way to ask gnuplot to eliminate/reduce the overlap between labels?

enter image description here

1 Answer 1

6

I think you could consider 3 options:

1) make your graph huge and hope your labels do not overlap
2) plot the points as different series with each item having its own legend
3) use letters instead of labels, you can put a letter at each point using

plot "???" using 1:2 plot "" using 1:2:(stringcolumn(3) ne 'compare to' ? 'if equal' : 'if not equal' ) with labels 

the stringcolumn function looks in column 3, compares the value to the string 'compareto' and if there is a match it puts 'if equal' at that location, otherwise 'if not equal'

Hence, I see something like Simulator in your graph, you could keep the green point and put an S with it/on it using

plot "" using 1:2:(stringcolumn(3) ne 'Simulator' ? 'S' : '' ) with labels 

I hope this helps.

Sign up to request clarification or add additional context in comments.

1 Comment

+1 I like the stringcolumn function and didn't know about that one.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.