0

I'm working in Gnuplot, and I have a graph looking roughly like the following:

Say

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!

mbm
  • 1,902
  • 2
  • 19
  • 28

3 Answers3

2

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.

Community
  • 1
  • 1
Tom
  • 5,219
  • 2
  • 29
  • 45
0

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.

brown.2179
  • 1,750
  • 1
  • 12
  • 15