MATLAB Answers

How do I add 2 Y axis to my MATLAB Plot?

Asked by Bharath Lohray on 1 May 2013

I know this question has been asked before - but none of them deal with a 3D plot with 2 Y axis. My question is a continuation of - or

I have now successfully managed to add a 2D plot along with a surface plot. See image below -

Now my problem is that the range of the 2D plot is so high that the 3D plot is shrunk to look like nothing more than a plane on the ceiling. It is supposed to have variations like the figure in the question I have lined above.

How do I provide a different Y axis for the 2D plot so that the 3D plot is not shrunk like it is here.


1 Answer

Answer by Babak
on 1 May 2013

Look up


in the documentation.

  1 Comment

Bharath Lohray on 1 May 2013

As I understand plotyy(), it is meant for 2D plots only and not for 3D plots.

Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi test

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!