How do I change the orientation and invert the Y-axis label of an Image plot?
조회 수: 4 (최근 30일)
이전 댓글 표시
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
채택된 답변
Star Strider
2022년 9월 1일
The y-direction is 'reverse' in image plots, so to correct it:
set(gca, 'YDir','normal')
.
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Annotations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!