I have a model, see code below:
n = 10;
lis = Table[i^4, {i, 0, 1, 1/n}];
grad = {1, 1, 9, 9, 9, 9, 9, 9, 10, 10, 10};
int = Interpolation[grad];
cf = Function[{x, f}, ColorData[{"AvocadoColors", {0, n}}][int[x]]];
cf2 = ColorData[{"AvocadoColors", {0, n}}] /@ grad;
g1 = ListLinePlot[lis, ColorFunction -> cf, ColorFunctionScaling -> False]
g2 = ListLinePlot[lis, ColorFunction -> cf2, ColorFunctionScaling -> False]
g3 = ListLinePlot[Table[{i, i^4}, {i, 0, 1, 1/n}], ColorFunction -> cf2, ColorFunctionScaling -> False]
I have tried coloring "lis" using the values in grad. for some reason, the method in g2 (using cf2) is not working and in g1 it is great (using cf) and that is the result I'm looking for. the problem is that in g3, when I'm trying to plot "lis" and scale the x-axis interpolation is not working well, how can I fit the results so g3 would be colored as g1 (using cf and not cf2)?