mee mee
mee mee

Reputation: 557

plotting gnuplot with palette showing some labels

I am plotting data series with gnuplot with command:

p 'file.txt' u 1:2:3 with labels

and got the graph with a lot of labels as below

enter image description here

which looks messy. So, i use different command:

p 'file.txt' u 1:2:3 with points pt 5 palette

which showed beautiful graph with colour spectrum. enter image description here

But it did not show the labels. Acutally I don't need to show all labels, but I would like to show lowest five and highest five values.

How can I mix these two commands so that I can show the graph with colour spectrum with 10 labels (5 for lowest five and another 5 for highest five). Thanks.

Upvotes: 2

Views: 1273

Answers (1)

Matthew
Matthew

Reputation: 7590

The labels style accepts a tc palette option

Thus you can do

plot datafile u 1:2:3:3 with labels tc palette

For example, with the following data

1 1 30
1 2 40
2 2 30
2 1 35
3 3 10
3 4 15

using plot datafile u 1:2:3:3 with labels tc palette will plot

enter image description here

In order to filter to only the top 5 and bottom 5 numbers, you will need to do some pre-processing of your data outside of gnuplot.

Upvotes: 3

Related Questions