如何使用R RGL 3D图获得相等大小的轴

发布于 2025-01-26 02:13:57 字数 418 浏览 3 评论 0原文

我正在用RGL包装绘制3D点图

par(mar = c(0, 0, 0, 0), cex.lab=1)
plot3d(cart$x,cart$y,cart$z,"X","Y","Z")

到目前为止, 。由于值,只有3个轴的大小不同。

我需要相同的尺寸轴。

这是当前输出。 所有3个轴都应转到10000,或者我设置的任何东西。

我该如何实现?

(xlim等我所理解的不起作用)

I am plotting a 3D point plot with the rgl-package with

par(mar = c(0, 0, 0, 0), cex.lab=1)
plot3d(cart$x,cart$y,cart$z,"X","Y","Z")

This work so far. Only the 3 axis are differently sized due to the values.

I would need identical sizes axes.

Here is the current output.
All 3 axes should go to 10000, or whatever I set.

enter image description here

How can I achieve this?

(xlim etc does not work as I understand)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

怕倦 2025-02-02 02:13:57

我认为您想要expack3d(1,1,1)(尽管没有给出可重复的示例),

?expack3d

expack3d(x,y = null,z = null)
如果比率全部为1,则边界框将显示为
立方体大约填充显示屏。值可能设置更大
或根据需要较小。

I think you want aspect3d(1,1,1) (although no reproducible example was given)

From ?aspect3d:

aspect3d(x, y = NULL, z = NULL)
If the ratios are all 1, the bounding box will be displayed as a
cube approximately filling the display. Values may be set larger
or smaller as desired.

谁对谁错谁最难过 2025-02-02 02:13:57

我终于通过在轴末端添加三个点来解决挑战。

endpoints <- read.table(header = TRUE, text = "
       x  y z
       -11000  0   0
       0  -11000 0
       0  0 11000
       ")
cart <- rbind(cart, endpoints)
plot3d(cart$x,cart$y,cart$z,"X","Y","Z")

也许不是最优雅的解决方案,但对我有用。

I finally solved the challenge by adding three points at the end of the axes.

endpoints <- read.table(header = TRUE, text = "
       x  y z
       -11000  0   0
       0  -11000 0
       0  0 11000
       ")
cart <- rbind(cart, endpoints)
plot3d(cart$x,cart$y,cart$z,"X","Y","Z")

Maybe not the most elegant solution, but it worked for me.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文