Panning plots over an image

Hi, I would like to pan an plot that is plotted over an image in the same axes. How do I transform/pan the plot separately from the image? Right now when I enable pan, it pans the axes as a whole. Thanks

Answers (1)

Use slice to plot it:
I = imread('cameraman.tif'); %sample image
H = slice(double(repmat(I,[1 1 2])),[],[],1); %slice it
set(H,'EdgeColor','none'); %required so image isn't just an edge
colormap gray %gray it
You may also want to look at my FEX:meshCanopy function that plots a mesh over an image with separate color maps. It might give you some ideas.

2 Comments

Hi Sean de, thanks for the fast answer but I'm not entirely sure how the slice function works. It can plot the image and the plot in a different plane? Do you know how I can focus the panning on just the plot? I'm working on labeling an image with facial features with plot coordinates and I want to be able to move the labels with the mouse cursor using the pan/transform tool.
The slice function shows images of slices through an image volume. As for being able to rotate the plot without rotating the image, I don't know how to do that.

Sign in to comment.

Categories

Asked:

on 7 Jul 2011

Community Treasure Hunt

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

Start Hunting!