({{, (RefLink[LineIntegralConvolutionPlot, paclet:ref/LineIntegralConvolutionPlot])[{{(Subscript[v, x]),(Subscript[v, y])},image},{x,(Subscript[x, min]),(Subscript[x, max])},{y,(Subscript[y, min]),(Subscript[y, max])}] 
generates a line integral convolution plot of image convolved with the vector field {(Subscript[v, x]),(Subscript[v, y])} as a function of x and y.}, {, (RefLink[LineIntegralConvolutionPlot, paclet:ref/LineIntegralConvolutionPlot])[{(Subscript[v, x]),(Subscript[v, y])},{x,(Subscript[x, min]),(Subscript[x, max])},{y,(Subscript[y, min]),(Subscript[y, max])}]
generates a line integral convolution plot of white noise with the vector field {(Subscript[v, x]),(Subscript[v, y])}.}})

OpenersNotesSection(Spacer1)Details and Options

(RefLink[LineIntegralConvolutionPlot, paclet:ref/LineIntegralConvolutionPlot]) creates a rasterized version of image, then does a line integral convolution of each pixel according to the field defined by the vector function {(Subscript[v, x]),(Subscript[v, y])}.

(RefLink[LineIntegralConvolutionPlot, paclet:ref/LineIntegralConvolutionPlot]) has the same options as (RefLink[Graphics, paclet:ref/Graphics]), with the following additions and changes:

If image is not specified, or is not already rasterized, a raster is created with a size specified by the (RefLink[RasterSize, paclet:ref/RasterSize]) option.

With a setting other than (RefLink[LightingAngle, paclet:ref/LightingAngle])->(RefLink[None, paclet:ref/None]), simulated lighting is used, with the height at each point being taken to be determined from the norm of the vector field.

The arguments supplied to (RefLink[ColorFunction, paclet:ref/ColorFunction]) are x, y, (Subscript[v, x]), (Subscript[v, y]), (RefLink[Norm, paclet:ref/Norm])[{(Subscript[v, x]),(Subscript[v, y])}].

OpenersPrimaryExamplesSection(Spacer1)Examples  (71)

OpenersExampleSection0(Spacer1)Basic Examples  (2)

Plot the line integral convolution for a vector field starting with a random background:

LineIntegralConvolutionPlot[{-1-x^2+y,1+x-y^2},{x,-3,3},{y,-3,3}]

Use an imported image:

house = ExampleData[{"TestImage","House"}]

LineIntegralConvolutionPlot[{{-y,x},house},{x,-3,3},{y,-3,3}]

OpenersExampleSection1(Spacer1)Scope  (12)

OpenersExampleSubsection0(Spacer1)Sampling  (5)

Transform an image by a line integral convolution:

image=Image[255 {BoxMatrix[20,100],BoxMatrix[30,100],BoxMatrix[40,100]},"Byte",ColorSpace->"RGB",Interleaving->False]

LineIntegralConvolutionPlot[{{x+y,x-y},image
},{x,1,100},{y,1,100},RasterSize->250,LineIntegralConvolutionScale->25]

Use an image directly as input:

LineIntegralConvolutionPlot[{{y,-Sin[x]},},{x,-4,4},{y,-3,3}]

Use an image created from a sparse matrix:

s = Image[Normal[1-SparseArray[{{i_,i_}->1,RandomInteger[{1,99},{1000,2}]->  ConstantArray[1,1000]}]]]

LineIntegralConvolutionPlot[{{y,x-x^3},s},{x,-2,2},{y,-2,2}, LineIntegralConvolutionScale->1]

Use a white noise background image with different levels of color quantization:

Table[LineIntegralConvolutionPlot[{{-1-x^2+y,1+x-y^2},k},{x,-3,3},{y,-3,3},PlotLabel->k],{k,{Automatic, {Automatic,320},{Automatic,320,6},{Automatic,320,64}}}]

Plot a field image, increasing the line integral convolution length:

Table[LineIntegralConvolutionPlot[{{-1-x^2+y,1+x-y^2},{Automatic,320,64}},{x,-3,3},{y,-3,3},PlotLabel->s,LineIntegralConvolutionScale->s],{s,{Automatic, 0.3,1.0,3}}]

OpenersExampleSubsection1(Spacer1)Presentation  (7)

Plot a field image and overlaid streamlines:

LineIntegralConvolutionPlot[{-1-x^2+y,1+x-y^2},{x,-3,3},{y,-3,3},StreamPoints->Coarse,StreamStyle->LightBlue]

Plot a field image and overlaid field vectors:

LineIntegralConvolutionPlot[{-1-x^2+y,1+x-y^2},{x,-3,3},{y,-3,3},VectorPoints->10,VectorStyle->White]

Plot a field image and overlaid vectors at random positions:

LineIntegralConvolutionPlot[{-1-x^2+y,1+x-y^2},{x,-3,3},{y,-3,3},VectorPoints->RandomReal[{-3,3},{200,2}],VectorStyle->White,VectorScale->Large]

Color the field magnitude:

Table[LineIntegralConvolutionPlot[{-1-x^2+y,1+x-y^2},{x,-3,3},{y,-3,3},PlotLabel->c,ColorFunction->c],{c,{Hue,"Pastel"}}]

Specify a color function that blends two colors by the x coordinate:

LineIntegralConvolutionPlot[{-1-x^2+y,1+x-y^2},{x,-3,3},{y,-3,3},ColorFunction->Function[{x,y,vx,vy,n},Blend[{Green,Red},x]]]

Fix the lighting angle at 0 (right of the plot), and vary the altitude from 0 to π/2:

Table[LineIntegralConvolutionPlot[{{y,-x},Sin[x^2+y^2]},{x,-3,3},{y,-3,3},PlotLabel->ϕ,LightingAngle->{0,ϕ}],{ϕ,0,Pi/2,Pi/4}]

Use a theme with detailed ticks and a legend:

LineIntegralConvolutionPlot[{-1-x^2+y,1+x-y^2},{x,-3,3},{y,-3,3},PlotTheme->"Detailed"]

OpenersExampleSection2(Spacer1)Options  (47)

OpenersExampleSubsection2(Spacer1)AspectRatio  (2)

By default, the aspect ratio is 1:

LineIntegralConvolutionPlot[{-1-x^2+y,1+x-y^2},{x,-3,3},{y,-3,3},AspectRatio->1]

Set the aspect ratio:

Table[LineIntegralConvolutionPlot[{-1-x^2+y,1+x-y^2},{x,-3,3},{y,-3,3},PlotLabel->a,AspectRatio->a],{a,{Automatic,Full,GoldenRatio}}]

OpenersExampleSubsection3(Spacer1)Background  (1)

Use colored backgrounds:

LineIntegralConvolutionPlot[{-1-x^2+y,1+x-y^2},{x,-3,3},{y,-3,3},VectorStyle->Yellow,FrameStyle->LightGray,Background->Gray]

OpenersExampleSubsection4(Spacer1)ColorFunction  (5)

Color the field magnitude using (RefLink[Hue, paclet:ref/Hue]):

LineIntegralConvolutionPlot[{-1-x^2+y,1+x-y^2},{x,-3,3},{y,-3,3},ColorFunction->Hue]

Use any named color gradient from (RefLink[ColorData, paclet:ref/ColorData]):

LineIntegralConvolutionPlot[{-1-x^2+y,1+x-y^2},{x,-3,3},{y,-3,3},ColorFunction->"Pastel"]

Use (RefLink[ColorData, paclet:ref/ColorData]) for predefined color gradients:

LineIntegralConvolutionPlot[{-1-x^2+y,1+x-y^2},{x,-3,3},{y,-3,3},ColorFunction->Function[{x,y,vx,vy,n},ColorData["SolarColors"][x y]]]

Specify a color function that blends two colors by the x coordinate:

LineIntegralConvolutionPlot[{-1-x^2+y,1+x-y^2},{x,-3,3},{y,-3,3},ColorFunction->Function[{x,y,vx,vy,n},Blend[{Green,Red},x]]]

Use (RefLink[ColorFunctionScaling, paclet:ref/ColorFunctionScaling])->(RefLink[False, paclet:ref/False]) to get unscaled values:

LineIntegralConvolutionPlot[{-1-x^2+y,1+x-y^2},{x,-3,3},{y,-3,3},ColorFunctionScaling->False,ColorFunction->Function[{x,y,vx,vy,n},ColorData[22][Round[n]]]]

OpenersExampleSubsection5(Spacer1)ColorFunctionScaling  (4)

By default, scaled values are used:

LineIntegralConvolutionPlot[{-1-x^2+y,1+x-y^2},{x,-3,3},{y,-3,3},ColorFunction->GrayLevel]

Use (RefLink[ColorFunctionScaling, paclet:ref/ColorFunctionScaling])->(RefLink[False, paclet:ref/False]) to get unscaled values:

LineIntegralConvolutionPlot[{-1-x^2+y,1+x-y^2},{x,-3,3},{y,-3,3},ColorFunctionScaling->False,ColorFunction->Function[{x,y,vx,vy,n},ColorData[22][Round[n]]]]

Use unscaled coordinates in the x direction and scaled coordinates in the y direction:

LineIntegralConvolutionPlot[{y Cos[x y],x Cos[x y]},{x,-3,3},{y,-3,3},ColorFunctionScaling->{False,True},ColorFunction->Function[{x,y,vx,vy,n},Hue[x,y,1]]]

Explicitly specify the scaling for each color function argument:

LineIntegralConvolutionPlot[{y Cos[x y],x Cos[x y]},{x,-3,3},{y,-3,3},ColorFunctionScaling->{True,True,True,True,False},ColorFunction->Function[{x,y,vx,vy,n},Hue[n,y,1]]]

OpenersExampleSubsection6(Spacer1)EvaluationMonitor  (1)

Count the number of times the vector field function is evaluated:

Block[{k=0},LineIntegralConvolutionPlot[{-1-x^2+y,1+x-y^2},{x,-3,3},{y,-3,3},EvaluationMonitor:>k++];k]

OpenersExampleSubsection7(Spacer1)Frame  (1)

Toggle the frame around the plot:

Table[LineIntegralConvolutionPlot[{-1-x^2+y,1+x-y^2},{x,-3,3},{y,-3,3},PlotLabel->f,Frame->f],{f,{True,False}}]

OpenersExampleSubsection8(Spacer1)FrameLabel  (1)

Label the axes:

LineIntegralConvolutionPlot[{-1-x^2+y,1+x-y^2},{x,-3,3},{y,-3,3},FrameLabel->{x,y}]

OpenersExampleSubsection9(Spacer1)FrameTicks  (8)

Place frame tick marks and labels automatically:

LineIntegralConvolutionPlot[{-1-x^2+y,1+x-y^2},{x,-3,3},{y,-3,3},FrameTicks->Automatic]

Put a frame, but no ticks:

LineIntegralConvolutionPlot[{-1-x^2+y,1+x-y^2},{x,-3,3},{y,-3,3},FrameTicks->None]

Place frame ticks and labels on all the edges:

LineIntegralConvolutionPlot[{-1-x^2+y,1+x-y^2},{x,-3,3},{y,-3,3},FrameTicks->All]

Place frame ticks on the right and top edges:

LineIntegralConvolutionPlot[{-1-x^2+y,1+x-y^2},{x,-3,3},{y,-3,3},FrameTicks->{{None,All},{None,All}}]

Place frame tick marks at the specified positions:

LineIntegralConvolutionPlot[{Sin[x y],Cos[x y]},{x,-π,π},{y,-π,π},FrameTicks->{{Table[k,{k,-π,π,π/2}],None},{Table[k,{k,-π,π,π/4}],None}}]

Draw frame ticks at the specified positions with the specific labels:

LineIntegralConvolutionPlot[{Sin[x y],Cos[x y]},{x,-π,π},{y,-π,π},FrameTicks->{{{-π,-180°},{-π/2,-90°},{0,0°},{π/2,90°},{π,180°}},None}]

Specify the style of each frame tick:

LineIntegralConvolutionPlot[{Sin[x y],Cos[x y]},{x,-π,π},{y,-π,π},FrameTicks->{{{π/2,90°,{.4,.05},Red},{-π/2,-90°,{.4,.05},Thick},{0,0°,{.4,.05},Directive[Red,Dashed]}},None}]

Specify overall frame ticks style, including frame tick labels, using (RefLink[FrameTicksStyle, paclet:ref/FrameTicksStyle]):

LineIntegralConvolutionPlot[{-1-x^2+y,1+x-y^2},{x,-3,3},{y,-3,3},FrameTicksStyle->Directive[Orange,12]]

OpenersExampleSubsection10(Spacer1)LightingAngle  (2)

Vary the lighting angle from 0 (right of the plot) to π/2 (top of the plot):

Table[LineIntegralConvolutionPlot[{{y,-x},Cos[x^2+y^2]},{x,-3,3},{y,-3,3},PlotLabel->θ,LightingAngle->{θ,0},Epilog->{Yellow,PointSize[.05],Point[3{Cos[θ],Sin[θ]}]}],{θ,0,Pi,Pi/2}]

Fix the lighting angle at 0 (right of the plot) and vary the altitude from 0 to π/2:

Table[LineIntegralConvolutionPlot[{{y,-x},Sin[x^2+y^2]},{x,-3,3},{y,-3,3},PlotLabel->ϕ,LightingAngle->{0,ϕ}],{ϕ,0,Pi/2,Pi/4}]

OpenersExampleSubsection11(Spacer1)LineIntegralConvolutionScale  (2)

An automatic scale is used by default:

LineIntegralConvolutionPlot[{-1-x^2+y,1+x-y^2},{x,-3,3},{y,-3,3},LineIntegralConvolutionScale->Automatic]

Use a specific scale:

Table[LineIntegralConvolutionPlot[{-1-x^2+y,1+x-y^2},{x,-3,3},{y,-3,3},PlotLabel->s,LineIntegralConvolutionScale->s],{s,{0.3,1.0,3}}]

OpenersExampleSubsection12(Spacer1)PerformanceGoal  (2)

Generate a higher-quality plot:

LineIntegralConvolutionPlot[{-1-x^2+y,1+x-y^2},{x,-3,3},{y,-3,3},PerformanceGoal->"Quality"]

Emphasize performance, possibly at the cost of quality:

LineIntegralConvolutionPlot[{-1-x^2+y,1+x-y^2},{x,-3,3},{y,-3,3},PerformanceGoal->"Speed"]

OpenersExampleSubsection13(Spacer1)PlotRange  (8)

The full plot range is used by default:

LineIntegralConvolutionPlot[{-1-x^2+y,1+x-y^2},{x,-3,3},{y,-3,3},PlotRange->Full]

Specify an explicit limit for both x and y ranges:

LineIntegralConvolutionPlot[{-1-x^2+y,1+x-y^2},{x,-3,3},{y,-3,3},PlotRange->2]

Specify an explicit range that applies to both x and y ranges:

LineIntegralConvolutionPlot[{-1-x^2+y,1+x-y^2},{x,-3,3},{y,-3,3},PlotRange->{-1,2.5}]

Specify an explicit x range:

LineIntegralConvolutionPlot[{-1-x^2+y,1+x-y^2},{x,-3,3},{y,-3,3},PlotRange->{{-1,2}}]

Specify an explicit x minimum range:

LineIntegralConvolutionPlot[{-1-x^2+y,1+x-y^2},{x,-3,3},{y,-3,3},PlotRange->{{0,Full}}]

Specify an explicit y range:

LineIntegralConvolutionPlot[{-1-x^2+y,1+x-y^2},{x,-3,3},{y,-3,3},PlotRange->{Full,{0,2}}]

Specify an explicit y maximum range:

LineIntegralConvolutionPlot[{-1-x^2+y,1+x-y^2},{x,-3,3},{y,-3,3},PlotRange->{Full,{Full,5}}]

Specify different x and y ranges:

LineIntegralConvolutionPlot[{-1-x^2+y,1+x-y^2},{x,-3,3},{y,-3,3},PlotRange->{{-2,1.5},{-1,2}}]

OpenersExampleSubsection14(Spacer1)PlotRangePadding  (6)

Padding is computed automatically by default:

LineIntegralConvolutionPlot[{-1-x^2+y,1+x-y^2},{x,-3,3},{y,-3,3},PlotRangePadding->Automatic]

Specify no padding for all x, y, and z ranges:

LineIntegralConvolutionPlot[{-1-x^2+y,1+x-y^2},{x,-3,3},{y,-3,3},PlotRangePadding->None]

Specify an explicit padding for all x, y, and z ranges:

LineIntegralConvolutionPlot[{-1-x^2+y,1+x-y^2},{x,-3,3},{y,-3,3},PlotRangePadding->0.5]

Add 10% padding to all x, y, and z ranges:

LineIntegralConvolutionPlot[{-1-x^2+y,1+x-y^2},{x,-3,3},{y,-3,3},PlotRangePadding->Scaled[0.1]]

Specify different padding for x and y ranges:

LineIntegralConvolutionPlot[{-1-x^2+y,1+x-y^2},{x,-3,3},{y,-3,3},PlotRangePadding->{1,0.5}]

Specify padding for the y range:

LineIntegralConvolutionPlot[{-1-x^2+y,1+x-y^2},{x,-3,3},{y,-3,3},PlotRangePadding->{Automatic,1.5}]

OpenersExampleSubsection15(Spacer1)PlotTheme  (2)

Use a theme with simple ticks in a vibrant color scheme:

LineIntegralConvolutionPlot[{-1-x^2+y,1+x-y^2},{x,-3,3},{y,-3,3},PlotTheme->"Marketing"]

Change the color scheme:

LineIntegralConvolutionPlot[{-1-x^2+y,1+x-y^2},{x,-3,3},{y,-3,3},PlotTheme->"Marketing",ColorFunction->"TemperatureMap"]

OpenersExampleSubsection16(Spacer1)RasterSize  (2)

By default, an automatic raster size is used:

LineIntegralConvolutionPlot[{-1-x^2+y,1+x-y^2},{x,-3,3},{y,-3,3},RasterSize->Automatic]

Set a specific raster size:

Table[LineIntegralConvolutionPlot[{-1-x^2+y,1+x-y^2},{x,-3,3},{y,-3,3},RasterSize->r],{r,{100,200,300}}]

OpenersExampleSection3(Spacer1)Applications  (5)

Use a line integral convolution plot as a background for an interactive demo:

Manipulate[Module[{sol, x,y,t},
sol = First[NDSolve[{x''[t] + x'[t]/2+Sin[x[t]]==0,Thread[{x[0],x'[0]}==point]},x,{t,0,10}]];
Show[lic, ParametricPlot[Evaluate[{x[t],x'[t]} /. sol],{t,0,10}, PlotStyle->Pink],PlotRange->{{-4,4},{-3,3}}]],{{point,{1,1}},Locator},Initialization:>{lic=LineIntegralConvolutionPlot[{y,-Sin[x]-y/2},{x,-4,4},{y,-3,3}]}]

Display characteristics of several different types of linear planar systems:

lmsp={(({{1, 0}, {0, 2}})),(({{1, 1}, {0, 1}})),(({{0, 1}, {-1, 1}})),(({{0, 1}, {-1, 0}})),(({{1, 0}, {0, -2}}))};
names = Map[Text, {"Nodal source", "Degenerate source", "Spiral source","Center","Saddle"}];
cases=Transpose[{lmsp,names}];

TabView[ParallelTable[MatrixForm[First[m]]->LineIntegralConvolutionPlot[Evaluate[First[m].{x,y}],{x,-1,1},{y,-1,1},PlotLabel->Last[m]],{m,cases}]]

Show the local direction of the gradient of a function along with its level curves:

f[x_,y_]:=(1-x)^2+ 100 (y-Sin[π x])^2;
L = 1.5;fplot = Show[LineIntegralConvolutionPlot[Evaluate[D[f[x,y],{{x,y}}]],{x,-L,L},{y,-L,L}],ContourPlot[f[x,y],{x,-L,L},{y,-L,L},ContourShading->None,ContourStyle->Pink]]

Use the image as a background for investigating different unconstrained optimization methods:

Manipulate[Module[{steps},
steps = Reap[Quiet[FindMinimum[f[x,y],Evaluate[Transpose[{{x,y},p0}]],Method->method,StepMonitor:>Sow[{x,y}]]]][[2,1]];
steps = Prepend[steps, p0];
Show[fplot,Graphics[{Green, Line[steps], {PointSize[0.025],Point[Last[steps]]}}],PlotRange->{{-L,L},{-L,L}}]],{{p0,{-1,-1}},Locator},{method,{Automatic, "Newton","GaussNewton","QuasiNewton","PrincipalAxis"}},SaveDefinitions->True]

Apply to a texture from (RefLink[ExampleData, paclet:ref/ExampleData]):

image=ExampleData[{"Texture","Bricks"}];
Show[image,ImageSize->150]

LineIntegralConvolutionPlot[{{Cos[(x^2)+y],1+x-(y^2)},image},{x,-3,3},{y,-3,3}]

Apply to rasterized text:

LineIntegralConvolutionPlot[{{Cos[(x^2)+y],1+x-(y^2)},Rasterize["Hello"]},{x,-3,3},{y,-3,3},Frame->None]

OpenersExampleSection4(Spacer1)Properties & Relations  (4)

Use (RefLink[ListLineIntegralConvolutionPlot, paclet:ref/ListLineIntegralConvolutionPlot]) to plot data:

data = Table[{{x,y},{y,x-x^2}},{x,-1.5,1.5,0.2},{y,-2,2,0.2}];

ListLineIntegralConvolutionPlot[data]

Other alternatives for visualizing vector field functions:

Table[f[{-1-x^2+y,1+x-y^2},{x,-3,3},{y,-3,3},PlotLabel->f],{f,{VectorPlot,VectorDensityPlot,StreamPlot,StreamDensityPlot}}]

Other alternatives for visualizing vector field data:

data=Table[{{x,y}=RandomReal[{-1.5,1.5},{2}],{{y,x-x^3},Abs[x+y]}},{300}];

Table[f[data,PlotLabel->f],{f,{ListVectorPlot,ListVectorDensityPlot,ListStreamPlot,ListStreamDensityPlot}}]

Use (RefLink[VectorPlot3D, paclet:ref/VectorPlot3D]) to visualize 3D vector fields:

VectorPlot3D[{x,y,z},{x,-1,1},{y,-1,1},{z,-1,1}]

OpenersExampleSection5(Spacer1)Neat Examples  (1)

Algorithmic texture generation:

LineIntegralConvolutionPlot[{{Cos[(x^2)+y],1+x-(y^2)},{"noise",500,500}},{x,-3,3},{y,-3,3},ColorFunction->"BeachColors",LightingAngle->0,LineIntegralConvolutionScale->3,Frame->False]

LineIntegralConvolutionPlot[{{Cos[x^2+y^3],Cos[y^2+x^3]},{Automatic,500,64}},{x,-3,3},{y,-3,3},ColorFunction->"Rainbow",LightingAngle->0,Frame->False]

LineIntegralConvolutionPlot[{{Sin[Cos[3 y]+3 x],Cos[Sin[3 y]+3 x]},{Automatic,500,64}},{x,-3,3},{y,-3,3},ColorFunction->"RoseColors",Frame->False, LightingAngle->0]

LineIntegralConvolutionPlot[{{Sin[Cos[3 y]+Sin[3 x]],Cos[Sin[3 y]+Cos[3 x]]},{Automatic,500,64}},{x,-3,3},{y,-3,3},ColorFunction->"DarkRainbow",Frame->False, LightingAngle->0]

LineIntegralConvolutionPlot[{{- Cos[3 y],   Sin[3 x]},{Automatic,500,265}},{x,-3,3},{y,-3,3},ColorFunction->"AlpineColors",LightingAngle->0,Frame->False,LineIntegralConvolutionScale->2]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[StreamPlot, paclet:ref/StreamPlot])  ▪  (RefLink[VectorPlot, paclet:ref/VectorPlot])  ▪  (RefLink[ListLineIntegralConvolutionPlot, paclet:ref/ListLineIntegralConvolutionPlot])  ▪  (RefLink[VectorPlot3D, paclet:ref/VectorPlot3D])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Vector Visualization, paclet:guide/VectorVisualization])}})}})