With contour of image how to change x and y axis?

조회 수: 7 (최근 30일)
Happy PhD
Happy PhD 2024년 12월 11일
댓글: DGM 2024년 12월 12일
I am plotting an contour of a matrix (image). How do I change the number of x and y axis to display angle values instead of pixel number?
If I know that 1 pixel is 0.135 mrad.
contour(imageslice)
with x-axis showing 1-30 pixel and y acis showing 1-70ish pixel.
Matrix consist of zeros and ones.
  댓글 수: 4
Happy PhD
Happy PhD 2024년 12월 12일
Ok, thanks. the "axis xy" help flip the axes so origo is at the lower corner. I decided to use "imagesc" since it gives me the crosssection image i needed. Thanks.
DGM
DGM 2024년 12월 12일
That works too.

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

답변 (1개)

Steven Lord
Steven Lord 2024년 12월 11일
As written you're using the contour(Z) syntax shown in the Syntax section on the contour function documentation page. The Description of that syntax states "The column and row indices of Z are the x and y coordinates in the plane, respectively."
Instead it sounds like you want to use the contour(X, Y, Z) syntax, which is described as "contour(X,Y,Z) specifies the x and y coordinates for the values in Z."

카테고리

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

태그

제품


릴리스

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by