필터 지우기
필터 지우기

How to create 4 axis on one single plot?

조회 수: 18 (최근 30일)
Christopher Brokmann
Christopher Brokmann 2018년 4월 12일
답변: Christopher Brokmann 2018년 4월 12일
Hello,
i need a plot with 4 axis. Two times abscissa and ordinate, top bottom, left and right. Background: e.g.: log(x) on bottom abscissa and corresponding x on top abscissa.
I tried plotyy, but but didnt get acceptable results
Thanks in advance

채택된 답변

Christopher Brokmann
Christopher Brokmann 2018년 4월 12일
Solved:
ax2.XTickLabelMode = 'manual'; ax2.XLim = [0 40];
works fine for this example.

추가 답변 (2개)

M
M 2018년 4월 12일
Maybe this solution is what you are looking for.

Christopher Brokmann
Christopher Brokmann 2018년 4월 12일
i tried this example, but have some problems to scale the xtick from the upper axis.
figure x1 = 0:0.1:40; y1 = 4.*cos(x1)./(x1+2); line(x1,y1,'Color','r') ax1 = gca; % current axes
ax1_pos = ax1.Position; % position of first axes ax2 = axes('Position',ax1_pos,... 'XAxisLocation','top',... 'YAxisLocation','right',... 'Color','none');
set(ax2,'XTickLabel',[0:5:40]) set(ax2,'xtick',get(ax1,'xtick'))
The set(ax2,'xtick',get(ax1,'xtick')) wont work ...

카테고리

Help CenterFile Exchange에서 Two y-axis에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by