2
$\begingroup$

I have the following code:

ListContourPlot[data,Mesh->None,ContourStyle->None, PlotLegends->Automatic, BaseStyle->Directive[Opacity[0.3]]]

enter image description here

Due to opacity, my legend coloring is not matching my ListContourPlot. Is there any way to fix this problem? I would really appreciate any help.

$\endgroup$

1 Answer 1

0
$\begingroup$

Use PlotLegends -> BarLegend[Automatic, BaseStyle -> Opacity[.3]] instead of PlotLegends -> Automatic:

SeedRandom[1]
data = RandomReal[1, {10, 10}]; 
ListContourPlot[data, Mesh -> None, ContourStyle -> None, BaseStyle -> Opacity[0.3],
 PlotLegends -> BarLegend[Automatic, BaseStyle -> Opacity[.3]]]

enter image description here

$\endgroup$

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.