フィルターのクリア

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

3 ビュー (過去 30 日間)
Yohan John
Yohan John 2016 年 5 月 11 日
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.

回答 (0 件)

カテゴリ

Help Center および File ExchangeSubplots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by