Heat Map Histogram with gnuplot
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!
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.
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.
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
精彩评论