Reputation: 1922
I'm working in Gnuplot, and I have a graph looking roughly like the following:
If I want to have the color of the line change color depending on the curves's values, what's the most straightforward way to make that happen?
Thanks!
Upvotes: 0
Views: 1437
Reputation: 1069
Maybe these three articles is helpful:
http://gnuplot-surprising.blogspot.com/2011/09/gradient-colored-curve-in-gnuplot0.html
http://gnuplot-surprising.blogspot.com/2011/09/gradient-colored-curve-in-gnuplot1.html
http://gnuplot-surprising.blogspot.com/2011/09/gradient-colored-curve-in-gnuplot2.html
Upvotes: 0
Reputation: 5309
Does the answer to this question help?
For example:
plot "./file.dat" u 1:2:2 with lines palette
where file.dat contains your data, the first column is the x axis and the second column is the y axis.
The repetition of the 2 indicates that the second column is also used for the colour.
Upvotes: 2
Reputation: 1880
I know there is a function (which i use quite a bit) on the matlab file exchange by Ken Garrard called plot3k that has this functionality that you're looking for. Mayhapes you could have a look at the implementation for hints for a gnuplot port.
Upvotes: 0