Heatmap is too Thin in Figure

4 visualizaciones (últimos 30 días)
Jack Gaunt
Jack Gaunt el 15 de Sept. de 2022
Respondida: J. Alex Lee el 15 de Sept. de 2022
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');

Respuestas (1)

J. Alex Lee
J. Alex Lee el 15 de Sept. de 2022
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"

Categorías

Más información sobre Data Distribution Plots en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by