Gnuplot - coloring a plot according to x-value
问题 I would like to change the color of a plot according to the x-value, for a function plot (i.e. not from a data file). For example, I define a palette as follows: set palette defined ( 0 'purple', 1 'blue', 2 'green', 3 'yellow', 4 'orange', 5 'red' ) and I wish to use the color the function sin(x) using my palette according to the x value for the range [0:5]. How can this be done? 回答1: You can use linecolor palette for this purpose, which requires the specification of an additional column