I am plotting a contour plot in Mathematica with Showlegend command, but trouble is that I am getting a black shadow with colorlegend which I want to remove.

    ContourPlot[SS[10^-3 t, λo xx], {t, 0, 0.2}, {xx, -4 λo, 4 λo}, 
    ColorFunction -> "Rainbow"], Ticks -> {{0.0, 0.05, 0.1, 0.15, 0.2}, 
    {-4 λo, -2 λo, 0, 2 λo, 4 λo}} {ColorData ["Rainbow"][1 - #1] &, 10, " 1", "-1", 
    LegendPosition -> {1.1, -0.4}}, ContourLabels -> False, 
    Contours -> 20, LegendShadow -> None, LegendBorderSpace -> 0, 
    Frame -> {{True, False}, {False, False}}, Axes -> True, 
    FrameLabel -> {Style[Time[ms], 12], Style[x, 12]}, 
    AspectRatio -> 0.5, LabelStyle -> Bold]

enter image description here


closed as off-topic by bbgodfrey, Michael E2, user9660, MarcoB, RunnyKine Mar 5 '16 at 20:31

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question cannot be answered without additional information. Questions on problems in code must describe the specific problem and include valid code to reproduce it. Any data used for programming examples should be embedded in the question or code to generate the (fake) data must be included." – bbgodfrey, Michael E2, Community, MarcoB, RunnyKine
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    $\begingroup$ Show your code and a picture of the result you obtain from it, so we can more easily help you. $\endgroup$ – MarcoB Mar 5 '16 at 15:52
  • $\begingroup$ You can format inline code and code blocks by selecting the code and clicking the {} button above the edit window. The edit window help button ? is also useful for learning how to format your questions and answers. You may also find this this meta Q&A helpful $\endgroup$ – Michael E2 Mar 6 '16 at 13:29
  • $\begingroup$ What version of Mathematica are you using? $\endgroup$ – Szabolcs Mar 6 '16 at 14:17
  • $\begingroup$ The code you posted is not self-contained. It can not be evaluated without additional information. Such as the definition of SS. Also, the PlotLegends package is obsolete and doesn't work well with recent version of Mathematica. What version are you running? $\endgroup$ – m_goldberg Mar 6 '16 at 14:27
  • $\begingroup$ Sorry, i forget to defined SS here, but in my program it is defined over there. I am using mathematica8. Problem is following. Colorlegend is not picking the color values from contour plot rather it is picking up the values which i defined in program eg. "1", "-1". Which make colarlegend inconsistent with contourplot. $\endgroup$ – Rahul Mar 7 '16 at 8:05

Use the option

LegendShadow -> None

From Plot Legends documentation

LegendShadow is an option for Legend that specifies the shadowing drawn around the legend.

  • $\begingroup$ this command is not working. $\endgroup$ – Rahul Mar 6 '16 at 7:53
  • $\begingroup$ Have you tried the examples in the documentation? I've tested once more to be sure and it worked as expected! It is supposed to be used as in ShowLegend[ (*Plot code*), { (*Legend code*) , LegendShadow -> None }] (note the {}) $\endgroup$ – Aisamu Mar 6 '16 at 13:27
  • $\begingroup$ Ya now it seem to be working, One more problem is coming, for contour plot particular color has a fix value but we can change the Colorlegend index "1", "-1" aw we wish. so how contour plot colorvariation will match with colorbar index. $\endgroup$ – Rahul Mar 7 '16 at 2:05
  • $\begingroup$ That is a different question altogether, and I don't think there is a straightforward way to do so with the old PlotLegends! You should try the new PlotLegends option (v9 upwards, I think) $\endgroup$ – Aisamu Mar 7 '16 at 13:32

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