Borrar filtros
Borrar filtros

How can I align an imagesc subplot with a line subplot?

3 visualizaciones (últimos 30 días)
Yohan John
Yohan John el 11 de Mayo de 2016
I am trying to align an image with a graph of the vertical sum of the image (a kind of image profile). But I cannot get the line plot's width to align with the imagesc of the plot above it. This is what I've tried:
A = randn(40);
sumA = sum(A)
h1 = subplot(211);
p1 = get(h1, 'pos');
imagesc(A), axis equal, axis off
h2 = subplot(212);
p2 = get(h2, 'pos');
p2(3) = p1(3);
set(h2, 'pos', p2);
plot(sumA)
The output is as shown in the image attached:
As you can see, the graph is much wider than the matrix shown by imagesc.

Respuestas (0)

Community Treasure Hunt

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

Start Hunting!

Translated by