Data cursor accuracy with imagesc
Show older comments
Hello everybody,
I need to increase the number of digits displaying by the data cursor when using it with imagesc. It's normally easy and can be done by editing the callback function by clicking "Edit Text Update Function" (see there for example : https://stackoverflow.com/questions/5961034/how-can-i-display-numbers-with-higher-precision-in-a-matlab-data-cursor ).
The issue is that, after changing this function, I obtain now only the values of X and Y and I have totally lost the values of "Index" and "RGB" normally displayed by the data cursor. Indeed, in the function that we change in "Edit Text Update Function", never "Index" or "RGB" appear. Do you now where the command that normally displays "Index" and "RGB" values is ? And, therefore, do you know how to solve my problem ? (ie: increasing the accuracy of X or Y without loosing the information "Index" and "RGB" normally showed by the data cursor).
I thank you in advance,
Best,
Alexandre
PS : Hereafter you can find a result of my data cursor before change and after change (I change the accuracy for displaying 6 digits instead of 4 for X and Y)


5 Comments
The event_obj argument that you get for your UpdateFcn contains the X, Y information and the target, which is your image object. You can index into the CData of this to get either index or RGB information, potentially interpolating if you wish, depending if you are viewing a greyscale indexed image or a true RGB image. If the former you can further map your greyscale index onto the current colourmap to get the RGB data.
Alexandre LEGAY
on 15 Jul 2019
Adam
on 15 Jul 2019
I'm afraid I don't know where the default functionality is. I wouldn't have a clue what the function is called to even search for it. It's one of those graphics based things, like creating a toolbar with only a subset of the usual buttons on, that I am not aware how to do without having to reprogram all the functionality myself. Someone else might know.
Adam
on 15 Jul 2019
Actually, it is possible to find the function names used by using the profiler, but the function where I assume this code is - DataCursorManager.createDatatip is in a p-code file so is not viewable code.
Alexandre LEGAY
on 15 Jul 2019
Answers (0)
Categories
Find more on Logical 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!