How can I create a plot with two different yaxis, with one of them inside the figure?
조회 수: 5 (최근 30일)
이전 댓글 표시
I'd like to produce a plot that has two different yaxis, sharing the same xaxis, but with one of them inside the plot itself. Thus, this script behaviour should be similar to the behaviour of yyaxis left/right, but the right axis should be inside the figure. For clarity's sake, I'd like to have an output similar to this (obtained with Paint):

I tried with subplot, but I was not successful. Do you have any suggestion to obtain such a graph?
댓글 수: 0
채택된 답변
Jan
2022년 5월 20일
편집: Jan
2022년 5월 20일
Simply create 2 axes:
FigH = figure;
Axes1H = axes(FigH, 'Position', [0.1300 0.1100 0.5 0.8150], ...
'Box', 'on');
Axes1H = axes(FigH, 'Position', [0.6300 0.1100 0.2750 0.8150], ...
'Box', 'on');
The axes can overlap also:
FigH = figure;
Axes1H = axes(FigH, 'Position', [0.1300 0.1100 0.7750 0.8150]);
Axes1H = axes(FigH, 'Position', [0.6300 0.1100 0.2750 0.8150]);
Adjust the XTicks accordingly to avoid overlapping labels.
댓글 수: 0
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!