Heatmap is too Thin in Figure
조회 수: 1 (최근 30일)
이전 댓글 표시
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');
댓글 수: 0
답변 (1개)
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"
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Colormaps에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!