TransWikia.com

Need help removing a legend

Mathematica Asked on November 29, 2020

I need to fix the following code

Plot[V[x], {x, -3, 3}, PlotRange -> {-3, 1}, PlotTheme -> "Detailed", 
 PlotStyle -> Automatic, AxesLabel -> Automatic, Frame -> True, 
 FrameLabel -> {Style["x", FontSize -> 22, Bold], 
   Style["V(x)", FontSize -> 22, Bold]}, ImageSize -> Large]

to remove the "—V(x)" right next to the Plot. It makes no sense because it’s the only function being plotted.

result of the code.

Thanks in advance.

2 Answers

An alternative approach to remove the legend: Take the first Part of Plot output:

plot = Plot[Sin[x] - 1, {x, -3, 3}, PlotRange -> {-3, 1}, 
  PlotTheme -> "Detailed", PlotStyle -> Automatic, 
  AxesLabel -> Automatic, Frame -> True, 
  FrameLabel -> {Style["x", FontSize -> 22, Bold], Style["V(x)", FontSize -> 22, Bold]},
  ImageSize -> Large]

enter image description here

First @ plot

enter image description here

Correct answer by kglr on November 29, 2020

As @kglr stated, this will do:

Plot[V[x], {x, -3, 3}, PlotRange -> {-3, 1}, PlotTheme -> "Detailed", 
 PlotStyle -> Automatic, AxesLabel -> Automatic, Frame -> True, 
 FrameLabel -> {Style["x", FontSize -> 22, Bold], 
   Style["V(x)", FontSize -> 22, Bold]}, ImageSize -> Large, 
 PlotLegends -> None]

and the Plot is fixed.

Answered by holahola on November 29, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP