O'Reilly logo

MATLAB Graphics and Data Visualization Cookbook by Swapnonil Banerjee, Nivedita Majumdar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The magnifying glass demo

A virtual magnifying glass function is developed in this recipe. Using this, you can load any image and run the virtual magnifying glass over it for closer inspection at your cursor tip. This recipe was adapted from Mingjing Zhang's submission on MATLAB Central File Exchange.

Getting ready

Load the image of a microtiter plate with a distribution of filled and empty wells:

userdata.img_rgb = imread('sampleImage.png');

How to do it...

Perform the following steps:

  1. Define parameters for passing to the callback function to be invoked in response to cursor movement:
    % The image size userdata.size_img = size(userdata.img_rgb); % the start time (to be used along with the frame rate % info to determine how often image should be updated) ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required