如何在由 PCA 系数和评分数据制成的双图上绘制一条线?

发布于 2024-10-18 06:03:34 字数 210 浏览 8 评论 0原文

我正在使用 coeff 和分数输出创建 PCA 数据的双图。我希望在双图上最远的点之间画一条线。我不确定如何在不自己添加的情况下向图中添加一条线(这会很乏味)。

我知道哪两点距离最远。 我的系数是 7x7,但我使用双标图的前 3 列以及分数矩阵中的第 1:3 列。

我将如何在这两点之间使用 line 或plot3 绘制一条线。似乎可以完成,但我不确定要为该行指定哪些数据。

I'm creating biplots of PCA data using the coeff and score outputs. I am looking to draw a line between the furthest points on the biplot. I'm not sure how add a line to the plot without adding it myself (which would be tedious).

I know which 2 points are the furthest away from each other.
My coeff is a 7x7, but I am using the first 3 columns for the biplot as well as columns 1:3 in my score matrix.

How would I go about plotting a line with either line or plot3 between these 2 points. It seems like it can be done but I am unsure of what data to specify for the line.

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

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

发布评论

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

评论(1

甜`诱少女 2024-10-25 06:03:34

plot3 接受 3 个输入作为 X、Y 和 Z 坐标。
因为您需要两点之间有一条线,所以您需要输入两个 3D 观测值
plot3(X1,Y1,Z1,...)

表示您的 2 个观测值之间距离最大的是第三个和第五个,

那么这

plot3(scores([3 5],1),scores([3 5],2),scores([3 5],3))

将为您提供所需的

快乐绘图!

plot3 accepts 3 inputs as the X,Y, and Z coordinates.
since you need a line between two points you need to input the two 3D observations
plot3(X1,Y1,Z1,...)

say that your 2 observations with the greatest distance between them are the 3rd and the 5th

then

plot3(scores([3 5],1),scores([3 5],2),scores([3 5],3))

would give you what you need

happy plotting!

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