I'm trying to use a piece of a BarLegend of a ListLineIntegralConvolutionPlot to plot other ListLineIntegralConvolutionPlot.


  • output of data1



  • output of data2

enter image description here

But for comparing these plots I would like

ListLineIntegralConvolutionPlot[ data2, BarLegend["something"]]

with an output of Bar $\approx$ and the plot inside this interval of colors.

Can someone help me? Thanks.


1 Answer 1


You may use the range syntax of ColorData for the BarLegend and for the ColorFunction option of the plot with the ColorFunctionScaling option set to False.

I use {0, 100} as the range. For a the full range.

BarLegend[{"Rainbow", {0, 100}}, LegendLayout -> "Row"]

Mathematica graphics

Then for range {0, 50} of {0, 100}

BarLegend[{ColorData[{"Rainbow", {0, 100}}], {0, 50}}, LegendLayout -> "Row"]

Mathematica graphics

Any sub-range can be obtain; {25, 75}

BarLegend[{ColorData[{"Rainbow", {0, 100}}], {25, 75}}, LegendLayout -> "Row"]

Mathematica graphics

Hope this helps.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.