3
$\begingroup$

I don't understand why AxesLabel and Ticks don't work with Show. I have the following examples. Everything works, but axes labels and ticks command don't work.

Manipulate[
 Show[{RegionPlot[{y < x}, {y, 0, 3}, {x, 0, 3}, 
    PlotLegends -> {"Hello"}], 
   Plot[{h 2 x^2, x^1/2}, {x, 0, 5}, PlotLegends -> {"e1", "e2"}]}, 
  AxesLabel -> {"x", "y"}, Ticks -> {{None, None}}], {h, 1/2, 1}] 

I already tried to put the command inside of the RegionPlot or Plot Command, but they don't work. I also changed axes ranges but still nothing.

Any help is much appreciated. Thanks in advance.

$\endgroup$

1 Answer 1

5
$\begingroup$

The plot generated by RegionPlot has the axes disabled in favor of Frame, so you'll have to either revert back to using axes, or just use the Frame-related options FrameLabel and FrameTicks:

Manipulate[
 Show[
  RegionPlot[{y < x}, {y, 0, 3}, {x, 0, 3}, 
   PlotLegends -> {"Hello"}],
  Plot[{h 2 x^2, x^1/2}, {x, 0, 5}, PlotLegends -> {"e1", "e2"}],
  FrameLabel -> {"x", "y"},
  FrameTicks -> None
  ],
 {h, 1/2, 1}
 ]

enter image description here

$\endgroup$
0

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.