pcshow - rescale axes on 3D pointcloud display
조회 수: 4 (최근 30일)
이전 댓글 표시
I'd like to rescale the axes shown from pcshow. See attached screeshot. I'd like to input some argument into the pcshow function so as to avoid manually rescaling the axes each time if possible.
Thank you :)
댓글 수: 0
답변 (2개)
Gonçalo Moreira
2021년 8월 25일
hey, you have to modify the DataAspectRatio property of the point cloud object, which defaults to [1 1 1]!
Here's an example on how to make all axis equal:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clear all; close all;
% Random point cloud with 1000 (x, y, z) triplets with a dimension of roughly 30x10x5
mat = [round(30*randn(1000,1)),round(10*randn(1000,1)),round(5*randn(1000,1))];
% Show point cloud
ax = pcshow(mat)
% Normalize the data relative to the Y axis
ax.DataAspectRatio = [diff(ax.XLim), diff(ax.YLim), diff(ax.ZLim)] / diff(ax.YLim);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Hope it helps!
참고 항목
카테고리
Help Center 및 File Exchange에서 Point Cloud Processing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!