How do I change the orientation and invert the Y-axis label of an Image plot?
8 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Tunde Adubi
am 1 Sep. 2022
Beantwortet: Star Strider
am 1 Sep. 2022
Is there a way I could flip the height to start from zero and also change the position of the plot in the same direction?
pts1 = linspace(0, 40, 41); % for heights
pts2 = linspace(-25, 70, 96); % for dBZ
N = histcounts2(heights(:), data.Z(:), pts1, pts2);
% 2D density plot
figure(1)
imagesc(pts2, pts1, N)
colorbar
set(gca,'ColorScale','log')
ylabel('Heights (Km)')
xlabel('(dBZ)')
title('CFAD')
grid on
caxis([0.1 10000])
colormap("jet")
0 Kommentare
Akzeptierte Antwort
Star Strider
am 1 Sep. 2022
The y-direction is 'reverse' in image plots, so to correct it:
set(gca, 'YDir','normal')
.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!