0

I have a curve as a function of x. The value at different x can be expressed in y1 units and well as y2 units.

I intend to plot the curve such that the left y-axis shows the value in y1 units while right y-axis of the panel shows it in the y2 units.

PS: I am trying to implement this in MATLAB.

user3440489
  • 259
  • 1
  • 4
  • 13
  • take a look at this here http://ch.mathworks.com/help/matlab/creating_plots/plotting-with-two-y-axes.html – rst Oct 07 '15 at 06:45
  • Thanks for replying. Actually what the link shows is 'two' curves with two different axes. I want the 'same' curve to be represented in two different units. Hope this makes the problem clear. – user3440489 Oct 07 '15 at 06:54
  • 1
    I got an answer here: http://stackoverflow.com/questions/2676004/different-right-and-left-axes-in-a-matlab-plot – user3440489 Oct 07 '15 at 07:00

1 Answers1

0

If you need to plot the same curve with two different axis, you can use the following example

x=1:1000; y = sort(randn(size(x)));
figure, plotyy(x, y, x, y*100, 'plot', 'plot')
rst
  • 2,510
  • 4
  • 21
  • 47