有没有办法在 gnuplot 中绘制没有 R 字符(即“i”、“o”或“u”)的表格?

问题描述 投票:0回答:1

有没有办法在 Windows 的 gnuplot 中绘制没有 R 字符(即“i”、“o”或“u”)的表格?

我试图对名称为 FILE: 的文件进行排序

set format y ""
set table $Data
plot FILE  u 1:2:1 smooth zsort
unset table

希望通过

set format y ""
去掉每行后面的“i”;但是当打印 $Data 时我又得到了它们。对于多列文件,您会在每列数字后面得到一列这些字符。

gnuplot
1个回答
0
投票

为了绘制到数据块/表并避免额外的

i
o
u
列,您可以使用绘图样式
with table
(选中
help with table
)。但是,
smooth
with table
不能一起使用。因此,您需要一个两步过程。

数据:

SO78337085.dat

4   4.1
3   3.1
7   7.1
1   1.1
9   9.1
6   6.1
5   5.1
2   2.1
8   8.1

脚本:(需要 gnuplot>=5.4.0,因为

smooth zsort

### sort data without extra header and range column
reset session

FILE = "SO78337085.dat"
set table $Data
    plot FILE u 1:2:1 smooth zsort
unset table
print $Data

set table $Data2
    plot $Data u 1:2 w table
unset table
print $Data2
### end of script

结果:

# Curve 0 of 1, 9 points
# Curve title: "FILE u 1:2:1"
# x y type
 1  1.1  i
 2  2.1  i
 3  3.1  i
 4  4.1  i
 5  5.1  i
 6  6.1  i
 7  7.1  i
 8  8.1  i
 9  9.1  i


 1       1.1
 2       2.1
 3       3.1
 4       4.1
 5       5.1
 6       6.1
 7       7.1
 8       8.1
 9       9.1
© www.soinside.com 2019 - 2024. All rights reserved.