imagesc is missing several rows of pixels when image has 1780 rows of pixel

3 ビュー (過去 30 日間)
raym
raym 2023 年 2 月 24 日
コメント済み: DGM 2023 年 2 月 26 日
% Simple demo to reproduce the bug.
% Purpose: show 2000x300 image by imagesc with yticklabel,
% then do "Y-only" zoom for fast free-hand eye-check of data quality in flexible Y ranges.
% Problem: imagesc shows misalignment with yticklabel in large images (2000X300)
% when doing Y-only zoom to a very high level.
% this may indicate missing of rows of pixles?
N = 2000;
A = rand(N,300);
imagesc(A)
set(gca,'YTick', 1:N,'YTickLabel',cellfun(@num2str,num2cell(1:N),'uni',0));
zoom yon
% then scrool to see
Hi,I am using imagesc to present the matrix data and need to view the details by Y-only zoom. When the number of row is not high, e.g., 300, after Y-only zoom I could see a perfect match of row of pixels with a ytick labelled. However, when the row numer is much higher as 1700, after Y-only zoom in the y-tick is ok, but the row of pixels does not match, as shown in image, It seems that several rows of pixels are lost in total, thus ytick is more dense than pixel rows. Is there a way to solve this problem? Thanks.
  6 件のコメント
raym
raym 2023 年 2 月 26 日
It is OK now.
I do not know what happened. Initially the bug was found in R2016a. I run the test code in R2017b and the tick is Ok.
Then I run in R2016a and found tick is also OK now.
The same file opened days ago in R2016a:
The same file opened just now in R2016a:
DGM
DGM 2023 年 2 月 26 日
That's weird. Maybe there were some stale changes to the figure from it having been used prior. Even though I always clear an existing figure with clf before starting to use it, I find that doesn't always reset all the properties.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeData Exploration についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by