3
$\begingroup$

I was plotting a function (F here) with selected values, and just wanted the plot to be solid lines with the selected colors specified with PlotStyle:

Plot[{F[11, 2, x*1*^-6], F[18, 22, x*1*^-6], F[54, 77, x*1*^-6], 
F[55, 78, x*1*^-6]}, {x, 0, 10*^3}, Frame -> True, 
FrameLabel -> {"Recoil energy (eV)", "Nuclear form factor"}, 
ImageSize -> Medium, 
PlotLegends -> { "23Na", "40Ar", "131 Xe", "133 Cs"}, 
PlotStyle -> {Red, Green, Blue, Orange}, 
LabelStyle -> {FontFamily -> "Courier", FontSize -> 14, Black}]

But when I evaluated this, I got the following output with dashed lines instead of solid lines:

Result of evaluating above code.

This was not a problem until last night, and it occurred every time I plotted something that I wanted to be solid lines. I don't remember doing anything weird either last night.

The only thing that fixed it was copying everything in the notebook and re-evaluating it from scratch in a new one.

If anyone has any idea on what could've caused this to occur, I would be happy to hear about this.

$\endgroup$
  • 1
    $\begingroup$ Does this still happen in a fresh kernel? Otherwise, it could just have been a glitch. $\endgroup$ – J. M.'s discontentment May 26 at 13:47
  • $\begingroup$ It disappeared after starting in a fresh kernel. I think Mr.Wizard was correct with his response. I still haven't figured out what changed the PlotTheme setting to Monochrome though... $\endgroup$ – David Trimas May 27 at 3:03
  • 1
    $\begingroup$ Perhaps you were trying things out earlier, and forgot about it. Usually, things you did at In[5] would still be remembered at In[1015]. $\endgroup$ – J. M.'s discontentment May 27 at 3:08
5
$\begingroup$

It appears something set $PlotTheme = "Monochrome";

$PlotTheme = "Monochrome";

Plot[{{x, x^2, Log[x], Exp[x]}}, {x, 0, 1}, Frame -> True, 
 FrameLabel -> {"Recoil energy (eV)", "Nuclear form factor"}, ImageSize -> Medium, 
 PlotLegends -> {"23Na", "40Ar", "131 Xe", "133 Cs"}, 
 PlotStyle -> {Red, Green, Blue, Orange}, 
 LabelStyle -> {FontFamily -> "Courier", FontSize -> 14, Black}]

enter image description here

| improve this answer | |
$\endgroup$
  • 3
    $\begingroup$ Looks like I was too hasty in removing plot-themes. (+1) $\endgroup$ – J. M.'s discontentment May 26 at 14:00
  • $\begingroup$ Thanks for the answer! I think this was the problem although I have not identified the cause yet of why PlotTheme was switched to monochrome. $\endgroup$ – David Trimas May 27 at 3:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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