如何使用绘图在gnuplot中绘制不同的线段 [英] How to draw distinct line segments in gnuplot using splot
问题描述
给我的印象是,在点之间引入空线会创建不连续的图.
I was under the impression that introducing an empty line between points creates disconnected plots.
如果文件Box.dat包含以下内容,则我希望恰好出现两个断开连接的线段.但是我在z平面上得到一个正方形.如何使gnuplot仅连接 未用换行符分隔的点?对于以下文件,我希望gnuplot生成2个线段:
If file Box.dat contains the following, I expect exactly two disconnected line segments to occur. However I get a square in the z plane. How do I get gnuplot to connect only the points not separated by a newline? For the following file I want gnuplot to generate 2 line segments:
Box.dat--------------------------
# Bounding box vertices
0 0 0
1 0 0
0 0 1
1 0 1
---------------------------------
gnuplot> splot 'Box.dat' using 1:2:3 with linespoints
推荐答案
在2D中(使用plot
),确实是,空行导致断开的线部分,请参见例如
In 2D (using plot
) it is true, that an empty line leads to disconnected line parts, see e.g.
set autoscale fix
set offset 0.5,0.5,0.5,0.5
plot 'Box.dat' using 1:3 w l
在3D中(使用splot
),换行符分隔曲面的两条线.然后将相邻线的相同点连接起来以形成一个表面.为了获得3D中断开的线段,您必须使用两个换行符:
In 3D (with splot
) a newline separates two lines of a surface. The same points of neighboring lines are then connected to form a surface. In order to get disconnected line segments in 3D you must use two newlines:
# Box.dat
0 0 0
1 0 0
0 0 1
1 0 1
这篇关于如何使用绘图在gnuplot中绘制不同的线段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!