user2655700
user2655700

Reputation: 53

value dependent color plot in gnuplot

My dataset is something like this:

<timestamp> <value>

Value ranges from 0 to 500000. I'm using GNUplot to plot my data (X marks). I would like to split my value range (0-500000) to e.g. 5 main ranges and assign them a color (example: 0-100000 is green, 100001-200000 is blue, etc.).

This is the (plot) command I use now:

plot "data/${Y}${m}${d}_strikes" using 1:2 with points title "lightning strike"

I've read about creating a palette. Can anyone help please?

Upvotes: 0

Views: 493

Answers (1)

user2655700
user2655700

Reputation: 53

I've found a solution:

set yrange [0:500000]
set cbrange [0:500000]
set palette defined ( 0 "green", 50000 "blue", 100000 "orange", 400000 "red" )
plot "data/${Y}${m}${d}_strikes" using 1:2:2 with points title "lightning strike" linecolor palette

Upvotes: 1

Related Questions