필터 지우기
필터 지우기

plot a graph with x-axis on top and y-axis on the left side

조회 수: 214 (최근 30일)
i wanted to plot a graph with x-axis on top and y-axis on the left side.... and the x-axis values should start from top left towards right side(that means 0 should come in top left side and 140 should come in the top right side)....and y-axis values from top left downwards(that means 0 should come in top left side and 400 should come in the bottom left side)..... when i did as below, the x-axis is coming correctly... but the y-axis values come in left side but 0 comes in bottom left side and 400 comes in the top left side.... what should i do to reverse the numbering in the y-axis)
set(gca, 'XTIck', [0:20:140])
set(gca, 'XAxisLocation', 'top')
set(gca, 'TickDir', 'out')
set(gca, 'YTIck', [0:50:400])
set(gca, 'YAxisLocation', 'left')
set(gca, 'TickDir', 'out')

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2013년 1월 17일
t=0:0.1:10;
y=sin(t);
plot(t,y)
set(gca,'XAxisLocation','top','YAxisLocation','left','ydir','reverse');
  댓글 수: 2
Elysi Cochin
Elysi Cochin 2013년 1월 17일
sir i did like this.....
set(gca, 'XTIck', [0:20:140], 'YTIck', [0:50:400])
set(gca,'XAxisLocation','top','YAxisLocation','left','ydir','reverse');
i'm getting as i wanted but the markings of x-axis is not being displayed only that of y-axis is being displayed.... can u please rectify that for me.....
Azzi Abdelmalek
Azzi Abdelmalek 2013년 1월 17일
편집: Azzi Abdelmalek 2013년 1월 17일
It should work, just check if your xticks are correct, can you post your code

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by