필터 지우기
필터 지우기

how to correct plotting

조회 수: 4 (최근 30일)
bay rem
bay rem 2016년 2월 10일
답변: Walter Roberson 2016년 2월 10일
when i'm trying to plot in my code, results seems to be flipped upside down...how can i correct it, and why it i that way? thank you in advance

채택된 답변

Walter Roberson
Walter Roberson 2016년 2월 10일
When you use image() or imagesc() or imshow(), MATLAB assumes you want "axis image", one side effect of which is to set the axis YDir to 'reverse'. It does this so that the "top" (lower row numbers) of the image show up at the top of the screen, because that is how people typically construct image arrays. Normally MATLAB follows Cartesian plotting conventions, where the low values are at the bottom of the screen with Y increasing upwards.
If you want your Y to increase from the bottom then you need to
set(gca, 'YDir', 'normal')
after you display your image. If this plots your image upside down from what you want, then you will need to ask to display flipud() of the image matrix,
imshow(flipud(YourArray))

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by