4
$\begingroup$

As suggested here, the way to be able to make a plot with two y axes is with Overlay. However, Overlay does not produce a graphics object which has many complications, the most basic one is, the plot cannot be resized. When I try to do

Show[Graphics[Overlay[{pl1,pl2}]]]

on the code from the link above, I get a nicely pink, yet empty rectangle.

So, is there any way, to make this work as I assume Overlay is just a very dirty way to produce to axes plots. I have read in some post that Export should work with Overlay objects but still, sometimes one just needs to play with the graphics in the GUI.

Also, is there any official Wolfram suggestion how to plot a two axes plots?

$\endgroup$
  • $\begingroup$ You can use Show to combine the preliminary prepared plots. The Y-axes should be normalized to the same value and the manual definition of the corresponding Ticks is needed. $\endgroup$ – Rom38 Aug 28 '17 at 6:00
5
$\begingroup$
Overlay[{plot1, plot2}]

Overlay[Show[#, ImageSize -> 500] & /@ {plot1, plot2}]

enter image description here

If Overlay is already created you can just do:

o = Overlay[{plot1, plot2}]

MapAt[Show[#, ImageSize -> 500] &, o, {1, All}]
$\endgroup$

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.