八度内的多个绘图调用
我正在八度音程中工作,我需要调用 plot3
两次或多次才能生成一张图表。但它只绘制了 plot3
的最后一次调用。我需要一些帮助。
这是我的代码: 它只绘制行 plot3(tras(1), tras(2), tras(3), 'bo');
p = [ 0.0, 0.0, 0.0
500.0, 0.0, 0.0
500.0, -500.0, 0.0
0.0, -500.0, 0.0
0.0, 0.0, 0.0];
mano = [119.818542 -43.371277 50.230591 1];
Tinv = [
0.998891 -0.001007 0.047065 64.223625
0.000000 0.999771 0.021382 -291.750854
-0.047076 -0.021359 0.998663 -1871.334229
0.000000 0.000000 0.000000 1.000000
]
tras = Tinv*mano'
hold("on");
xlabel("X");
ylabel("Y");
zlabel("Z");
plot3(p(:,1), p(:,2), p(:,3), 'r*-');
plot3(tras(1), tras(2), tras(3), 'bo');
hold("off");
pause;
I'm working in octave, I need to call plot3
two or more times to produce one graph. But it only plots the last call of plot3
. I need some help.
This is my code:
It only plots the line plot3(tras(1), tras(2), tras(3), 'bo');
p = [ 0.0, 0.0, 0.0
500.0, 0.0, 0.0
500.0, -500.0, 0.0
0.0, -500.0, 0.0
0.0, 0.0, 0.0];
mano = [119.818542 -43.371277 50.230591 1];
Tinv = [
0.998891 -0.001007 0.047065 64.223625
0.000000 0.999771 0.021382 -291.750854
-0.047076 -0.021359 0.998663 -1871.334229
0.000000 0.000000 0.000000 1.000000
]
tras = Tinv*mano'
hold("on");
xlabel("X");
ylabel("Y");
zlabel("Z");
plot3(p(:,1), p(:,2), p(:,3), 'r*-');
plot3(tras(1), tras(2), tras(3), 'bo');
hold("off");
pause;
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你的绘图代码没问题。尝试使用 axis 函数增大绘图范围。以下更改:
导致下图:

理想情况下,您可以使
axis
中的范围值相对于最小值和p
和tras
中的最大坐标值。Your plotting code is fine. Try making the plot extents larger with the axis function. The following change:
Results in the following plot:

Ideally, you would make the extents values in
axis
relative to the minimum and maximum coordinate values inp
andtras
.