필터 지우기
필터 지우기

shifting x-axis

조회 수: 7 (최근 30일)
Syed Abbas
Syed Abbas 2012년 1월 17일
Hi,
I want to shift the x-axis from the bottom to the top of a figure using the command line. I know how to do it by using the plot tools. I would like to know how to do it via the command line. Thanks

채택된 답변

the cyclist
the cyclist 2012년 1월 17일
plot(1:10)
set(gca,'XAxisLocation','top')
  댓글 수: 3
Syed Abbas
Syed Abbas 2012년 1월 17일
Just a follow up question, is it possible to create two copies of the x-axis, one positioned at the bottom and the other positioned at the top?
the cyclist
the cyclist 2012년 1월 17일
Probably the easiest way to plot two axes is with the plotyy() function. For example:
figure
[ax,h1,h2] = plotyy(1:10,1:10,1:10,2:11);
set(ax(1),'XAxisLocation','top')
set(ax(2),'XAxisLocation','bottom')
If you don't have two set of data to plot, you use "NaN" in place of the second pair of x-y data.
[If you have more detailed questions, you might want to start another thread, so it doesn't get lost in the comments. I think people tend to ignore questions that have accepted answers.]

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

추가 답변 (0개)

카테고리

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