I have an array of 128x256 data points in a rectilinear array. For each point there is a 2D vector quantity and a scalar quantity (normalised to -1 <= x <= 1).
I very much like the ListLineIntegralConvolutionPlot function for plotting the vector field, I think the fine detail is wonderfully captured. I also think the ListContourPlot function with the "TemperatureMap" ColorFunction does a great job of showing the structure of the scalar field.
I have experimented using ListStreamPlot over the contour plot and had reasonable results. See the image (a few extra graphics items are placed over the top as well).
My wish is to create a similar plot with the line integral convolution plot in place of the stream lines. To prevent the LIC plot completely obscuring the underlying contour plot I was hoping to have the noise that is to be convolved made transparent based on each pixels value (blackness) such that white pixels are completely transparent and black pixels are completely opaque, with the in-between greys mapping linearly between them.
For example, the noise image here:
Would become this (but convolved by the vector field.)
I've tried supplying the transparent noise as an image to the LIC routine without success and I feel there must be a smarter, more Mathematica, solution to this problem.
If anyone can suggest one, I would be very thankful.
As an added challenge I will be producing ~150 of these plots. The LIC is already a slow process so I don't want to add to this time. More performant solutions would be even better!
EDIT:
Many thanks to LLlAMnYP. I tweaked the contrast on the LIC image a little to get a 'better' contrast between the light and dark areas. My final Plotting function is (simplified...):
licplot[scal_, vec_] := Show[{
ListContourPlot[
scal,
ColorFunction -> "TemperatureMap",
PlotRange -> {{-5, 5}, {-2.5, 2.5}, {-1, 1.0}}, AspectRatio -> 0.5,
ClippingStyle -> {Blue, Darker[Red]}, BaseStyle -> {14}],
ListLineIntegralConvolutionPlot[vec, AspectRatio -> 0.5,
ColorFunction -> (RGBColor[#5, #5, #5] &), RasterSize -> 720,
LineIntegralConvolutionScale -> 3]
/. {r_, g_, b_} -> {r^2, g^2, b^2, 1 - (1/(1 + Exp[-20*(r - 0.5)]))}
]
Giving the very nice result of:
ColorFunction
should do the trick, I think. $\endgroup$ListStreamPlot
rather thanListStreamLinePlot
? $\endgroup$SetAlphaChannel[]
with the noise image setting the transparency? Or, useImageCompose[]
for an overlay, after setting the alpha channel of the noise image appropriately… $\endgroup$