Good afternoon,
I have the MATLAB R2016b release and I need to have a plot with the following scheme but I do not know how to do it:
  • Two line plots with different axis in the left side of the plot and one area plot with the right axis.
I prove with yyaxis left and right, ploty, addaxis but I have not managed to get it out.
Can anyone help me please?
Thanks in advance.
Manuel

답변 (1개)

Fangjun Jiang
Fangjun Jiang 2020년 3월 18일

0 개 추천

https://www.mathworks.com/help/releases/R2019b/matlab/creating_plots/plotting-with-two-y-axes.html

댓글 수: 4

Manuel Montesinos del Puerto
Manuel Montesinos del Puerto 2020년 3월 18일
편집: Manuel Montesinos del Puerto 2020년 3월 18일
With my MATLAB R2016b I know how to make a plot with two y different axis on the left Y axis, but I do not get it out how to plot also and area plot in the right Y axis. This is my real problem.
Fangjun Jiang
Fangjun Jiang 2020년 3월 18일
area(AX, ___ ), plots into the axes specified by AX instead of the current axes. ??
Maybe you need to provide a scatch to show what is your desired effect.
Manuel Montesinos del Puerto
Manuel Montesinos del Puerto 2020년 3월 19일
Sorry, maybe I explain badly the result I want to get out.
The following image describes better which is the result wanted:
  • The green one (LINE PLOT 1 - left Y) and the black (AREA PLOT - right Y) have been created using yyaxis right and left function. Perhaps there is a better way to do it.
  • Then the only thing I do not know how to do is adding the red axis (LINE PLOT 2 - left Y).
Thanks in advance!
Fangjun Jiang
Fangjun Jiang 2020년 3월 19일
Sorry, as far as I know, you can only have two y-axis (left and right). No third y-axis.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

제품

릴리스

R2016b

댓글:

2020년 3월 19일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by