I would like to transfer the colors of a ListContourPlot to a ListLIC-Plot.
I tried to interpolate the data of the ListContourPlot and use it as ColorFunction for the second plot but I couldn't get it to work properly, is there a better way to do this?

2 Answers
2

You need to set ColorFunctionScaling -> False, otherwise the $x$ and $y$ passed into your ColorFunction are rescaled to lie between 0 and 1 instead of having their original values.

There's a discrepancy between how ListContourPlot and ListLineIntegralConvolutionPlot interpret the dimensions of the input arrays as $x$ and $y$ coordinates. So to get the image you say you want, you have to use f[y, x] in the ColorFunction. Still, I think it's quite likely that the image you actually want is the one with f[x, y], because then the colours correspond to the $x$-component of the velocity field as one might expect from the definitions of data1 and data2.

Finally, we have to rescale f to a $[0,1]$ range manually, say using Rescale, before passing it into ColorData.

Mathematica is a registered trademark of Wolfram Research, Inc. While the mark is used herein with the limited permission of Wolfram Research, Stack Exchange and this site disclaim all affiliation therewith.