Subplotting images with different scale
Mostrar comentarios más antiguos
Hello,
I need some help. I want to show two different images (100x100 and 400x400). I could show them in different figures respecting their scale factor, but what I would like is to show both of them in the same figure. I mean one next to the other but respecting their scale, because what Matlab do is to show both image at the same scale but I want to respect their proportion to compare them (one smaller and one bigger)
Thank you for your help.
Regards,
Daniel
Respuesta aceptada
Más respuestas (4)
Pramod Bhat
el 25 de Ag. de 2011
0 votos
I don think your need has any particular application.
3 comentarios
Daniel
el 25 de Ag. de 2011
Sean de Wolski
el 25 de Ag. de 2011
There are dozens of applications for this. A simple one, that I used in my MS thesis, was for a block matching program, I wanted to show the small block at its real scale (16x16 pixels) and the big block at its real scale (32x32 pixels). On top of that I can think of numerous different reasons for it.
Sean de Wolski
el 25 de Ag. de 2011
*instead of dozens, I meant to say millions*
BF83
el 25 de Ag. de 2011
0 votos
I'm not sure, but perhaps you can use 'pbaspect'.
Sean de Wolski
el 25 de Ag. de 2011
Create the figure and axes explicitly and then use them:
H.f = figure; %new figure
set(H.f,'units','pix','position',[100 100 700 500]); %needed size and pixels as units
H.A(1) = axes('units','pix','position',[50 50 100 100]); %small image axis
H.A(2) = axes('units','pix','position',[250 50 400 400]); %big image axis
%
axes(H.A(1));
imshow(magic(100),[]); %small magic square
axes(H.A(2));
imshow(magic(400),[]); %big magic square
Walter Roberson
el 25 de Ag. de 2011
0 votos
image() and imagesc() allow you to specify the coordinates of the lower-left and upper-right pixel centers (not edges). You can place two images on the same axes in arbitrary relation to each other by choosing appropriate offsets and taking in to account the half-width to the pixel edges. The coordinates are data coordinates by default.
Categorías
Más información sobre Subplots en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!