pcshow - rescale axes on 3D pointcloud display

4 ビュー (過去 30 日間)
Abbas Husain
Abbas Husain 2021 年 3 月 22 日
コメント済み: Vadim Konradi 2021 年 10 月 14 日
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 :)

回答 (2 件)

Gonçalo Moreira
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!
  1 件のコメント
Vadim Konradi
Vadim Konradi 2021 年 10 月 14 日
That works, thanks!

サインインしてコメントする。


darova
darova 2021 年 3 月 22 日
try
axis equal
  1 件のコメント
Abbas Husain
Abbas Husain 2021 年 3 月 22 日
Thanks @darova but sadly no luck trying this

サインインしてコメントする。

カテゴリ

Help Center および File ExchangePoint Cloud Processing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by