필터 지우기
필터 지우기

I want to scale each pixel width and height in imagesc but not use pcolor command

조회 수: 7 (최근 30일)
Hello,
I want to scale each pixel width and height in imagesc but not use pcolor command. The reason I don't want to use pcolor is it plots the center of each (x1-x2) and (y1-y2). Is there any adjustments in imagesc that plot an image with different pixel sizes according to x and y values?
Thanks Farz

채택된 답변

Walter Roberson
Walter Roberson 2016년 8월 17일
imagesc() accepts 'XData' and 'YData' parameter, which together allow you to control the data coordinates of the center of the lower-left and upper-right pixels. The axes properties XLim, YLim, DataAspectRatio, Position, and Units then work together to determine the mapping of data coordinates to physical screen coordinates.
For example if you had arranged for a square plotting box area, and you had a square data array, then using imagesc() 'XData' [0 10], 'YData', [0 20] would place the center of the lower left at [0 0] and the center of the upper right at [10 20] which would have the effect of making the Y scale twice as large as the X scale for the image.
  댓글 수: 5
Walter Roberson
Walter Roberson 2016년 8월 19일
I = rand(32,32); imagesc(I, 'XData', [.5 32.5], 'YData', [.5 65]); axis image
The pixels that come out will not be square.
Farz Tak
Farz Tak 2016년 8월 19일
Thanks but as you see this scale the width and height of the whole plot. What I am looking for is what that can draw each pixel based on its x and y (like what we have in all 1-D plots).

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

추가 답변 (0개)

카테고리

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

제품

Community Treasure Hunt

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

Start Hunting!

Translated by