2

我正在尝试使用 gnuplot 重现我在线性代数书中找到的数字。这是原图路口

您可以看到两个方程式描述的两个平面之间的交点:

  • 2u + v + w =​​ 5
  • 4u - 6v = -2。

我想为了使用 gnuplot 绘制第一个方程,我必须将其转换为以下形式:

splot 5 - 2*x - y

其中 u -> x; v -> y 和 w -> z 这是自由变量。但结果与预期大相径庭。有什么线索吗?

结果

4

1 回答 1

2

您概述的方法是有道理的,但是,结果可能与您的预期相去甚远。我建议您使用gnuplot
中的函数绘制单线。 此示例将生成一个与您显示的非常相似的图(尽管只有一个平面): arrow

set term gif
set output "demo_plane.gif"

# define your axis limits:
xmax =   6.5             
xmin =  -1.5
ymax =   8.5                 
ymin =  -1.5
zmax =   5.5
zmin =  -0.5                  
set xrange [xmin:xmax]
set yrange [ymin:ymax]
set zrange [zmin:zmax]

# remove the original axis
unset border
unset xtics
unset ytics
unset ztics

# define you data points:
x1 =  3.0
y1 = -1.0
z1 =  0.0

x2 = -1.0
y2 =  7.0
z2 =  0.0

x3 = -3.0
y3 =  7.0
z3 =  4.0

x4 =  1.0
y4 = -1.0
z4 =  4.0

# define 'arrow' without head:
set arrow 1 from x1,y1,z1 \
              to x2,y2,z2 nohead  

set arrow 2 from x2,y2,z2 \
              to x3,y3,z3 nohead  

set arrow 3 from x3,y3,z3 \
              to x4,y4,z4 nohead  

set arrow 4 from x4,y4,z4 \
              to x1,y1,z1 nohead  

# draw new axis manually (again, using arrow):
set arrow 5 from 0,0,0 \
              to 6,0,0   

set arrow 6 from 0,0,0 \
              to 0,6,0   

set arrow 7 from 0,0,0 \
              to 0,0,5 

# annotate axis labels:
set label "u" at 6.25,0,0
set label "v" at 0,6.25,0
set label "w" at 0,0,5.25

# plot will not show when empty, include dummy plot command:
set parametric 
splot x1, y1, z1 not

稍微旋转一下,您将得到如下图:

在此处输入图像描述

于 2013-08-15T17:32:06.563 回答