Panning plots over an image
Show older comments
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)
Sean de Wolski
on 7 Jul 2011
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
Khoa
on 7 Jul 2011
Sean de Wolski
on 8 Jul 2011
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.
Categories
Find more on Color and Styling 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!