匹配轴刻度 [英] Matching axes scales

查看:90
本文介绍了匹配轴刻度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用'plot3'函数绘制了3D数据.我想约束Y和Z轴,使它们的比例相等. X轴应照常自动缩放.

I have 3D data plotted using the 'plot3' function. I would like to constrain the Y and Z axes such that they are equal in scale. The X axis should be automatically scaled as usual.

我从此处知道,我可以制作X轴是使用命令自动缩放的唯一轴:

I know from here that I can make the X axis be the only one to be automatically scaled by using the command:

axis 'auto x';

但是,这将导致Y和Z轴仅从0到1绘制;我的数据通常在所有轴上都超出此范围.我要寻找的是一个在单个视图中包含所有数据的图,但Y或Z轴的最小比例被缩小,以使Y和Z轴的比例相等.

However, this causes the Y and Z axes to be plotted from 0 to 1 only; my data often exceeds this in all axes. What I'm looking for is a plot which contains all the data in a single view, but with the smallest of the Y or Z axes scaled down so that the Y and Z axes are equivalent in scale.

任何帮助都会感激不尽.

Any help would be gratefully received.

推荐答案

尝试daspect.

plot3(5*rand(10,1),10*rand(10,1),rand(10,1))

tmpAspect=daspect();
daspect(tmpAspect([1 2 2]))

daspect()返回由轴"auto"产生的当前纵横比.

daspect() returns the current aspect ratio as produced by axis 'auto'.

daspect(tmpAspect([1 2 2]))强制y和z具有相同的比例.

daspect(tmpAspect([1 2 2])) then enforces that y and z have the same scale.

这篇关于匹配轴刻度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆