Heatmap is too Thin in Figure

8 ビュー (過去 30 日間)
Jack Gaunt
Jack Gaunt 2022 年 9 月 15 日
回答済み: J. Alex Lee 2022 年 9 月 15 日
How do I make this fill the figure or at least make it square?
figure('visible', 'off');
h = histogram2(x,y,50);
figure('visible', 'on');
imshow(heatmap,[], 'XData', h.XBinEdges, 'YData', h.YBinEdges, 'InitialMagnification', 'fit');
axis on;
ax = gca;
ax.YDir = 'normal';
colormap(cmap_green);
c = colorbar;
c.Label.String = 'Average Predicted vs Actual NOx';
xlabel('Engine Speed');
ylabel('Torque');

回答 (1 件)

J. Alex Lee
J. Alex Lee 2022 年 9 月 15 日
imshow() asserts 1:1 aspect ratio to show the image, so you can manually change the axes Position property after setting DataAspectRatioMode property to "auto"

カテゴリ

Help Center および File ExchangeData Distribution Plots についてさらに検索

タグ

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by