Set image aspect ratio using imshow
21 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Gerard Capes
el 18 de Ag. de 2017
Comentada: Adam
el 18 de Ag. de 2017
I am trying to load an image (screenshot of a graph), and plot my data on top. I have achieved this, but the aspect ratio of the displayed image/graph doesn't look to be adjustable. Can it be done?
% Load cleaned up screen shot.
load image.mat
% Observe aspect ratio.
imshow(I)
% Flip matrix so that y axis origin is at the bottom instead of the top.
I = flipud(I);
% Scale image to allow plotting on top - this works, but changes the aspect ratio.
RI = imref2d(size(I));
RI.XWorldLimits = [1970 2020];
RI.YWorldLimits = [320 410];
figure;
imshow(I,RI);
set(gca,'YDir','normal');
0 comentarios
Respuesta aceptada
Más respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!