Data Cursor Position Does not Match Mouse Position in Figure Zoom

2 views (last 30 days)
Hello,
I am using Matlab 2014b and I am reading in a large csv text file. The file size is 3000 x 4224. When I open the file using:
img = csvread(filename);
img = img';
figure1 = imagesc(img);
I get the normal figure window opening and the correct image in the figure. Selecting the Data Cursor, I can click anywhere in the image a retrieve the value of the 'pixel' I have selected. When I zoom in though, the Data Cursor goes crazy. When I select a pixel to get it's value, the data cursor selects a point far away from the pixel I selected.
It's almost as if the Figure window thinks my zoomed selection is still the entire image, that is, the mouse selection and Data Cursor have been decoupled so that if I select the left and right edges of my zoomed area, the Data cursor selects the left and right edges of the entire unzoomed image. This causes the data cursor to select points that are not visible in my zoomed image.
I tried using a new figure with imagesc(rand(100)) and the issue is not present, so I am thinking it might be because I am reading in a csv file?
The problem also exists if I remove:
img = img';
Any ideas? Thanks!
I also just tried saving my data as an ASCII file. I then used DLM read to open the ASCII file, and using imagesc, the problem still persists.
  2 Comments
Mark Veillette
Mark Veillette on 21 Jan 2015
I am also experiencing this issue. I'm only seeing it for "large" images. Even doing
imagesc(rand(3000))
will duplicate this.
Alexandra Vossen
Alexandra Vossen on 9 Sep 2017
Hi,
I know this is an old thread but I have a similar problem now in MATLAB2017a so I thought they might be related.
When I try to zoom into a graph, the zoom window that is drawn on the figure and the virtual window "drawn" by the cursor do not match, and the figure will zoom onto the virtual rather than the actually drawn window. This only seems to happen in full screen mode, while the amount of data plotted seems to be irrelevant (it happens for a plot of a single data point). I'm running Matlab on Linux version 4.9.48-1-MANJARO (64bit).
What could be causing this behaviour?
Thanks!

Sign in to comment.

Accepted Answer

Jinsheng
Jinsheng on 28 Apr 2015
I just contacted the Mathworks group and they were able to fix this: It's a bug of version 2014b, and they have a patch for it:
https://www.mathworks.com/support/bugreports/1133258
Just want to post the answer here in case other people have the similar issue.

More Answers (2)

Jinsheng
Jinsheng on 28 Apr 2015
same issue here as well. I think it's specific for large images and 2014b.

Joe
Joe on 28 Apr 2015
We upgraded to 2015a, and I when I do a
imagesc(rand(2000))
I do not get the issue any more. So I believe that yes, issue is specific to 2014b

Categories

Find more on Visual Exploration in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!