Merge imagesc and plot into same figure
3 views (last 30 days)
Show older comments
Hi all,
My code creates an imagesc figure from a matrix and later on, it creates a plot from two arrays. It works properly separately.
I would like to merge both figures, where the imagesc should fit into the plot. The problem is that the plot goes to a corner of the imagesc figure. I need the plot much bigger and the imagesc figure in the center of it.
I'm using hold on and hold off.
This is what i'm getting
This is what i would like to get (done with paint):
0 Comments
Accepted Answer
Doug Hull
on 27 Mar 2013
i = magic(10)
imagesc(i)
imagesc(10:10:100, 10:10:100,i)
When you call imagesc, if you do not give an X and Y vectors, they default to the indices (1 through number of pixels)
When you do a plot, the plot is at a different scale on the X and Y. In the above example, I changed the X and Y vectors. you could choose appropriate X and Y vectors to scale the image to the plot.
More Answers (0)
See Also
Categories
Find more on Annotations 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!