1

我必须绘制 10 个具有相同图例的文件,但我还需要在文件中排序数字,因为当我在 gnuplot 上写一行时,它会显示一些不好的图像。有些数字必须在其他数字之前才能在我的图表上显示一条连续线。看着红线可以明白我的意思。有没有办法做到这一点?

plot '<paste ../00/Statistic100.txt ../01/Statistic100.txt ../02/Statistic100.txt ../03/Statistic100.txt ../04/Statistic100.txt ../05/Statistic100.txt ../06/Statistic100.txt ../07/Statistic100.txt ../08/Statistic100.txt ../09/Statistic100.txt' with linespoint ls 1 title 'Reputation until 100%'

提前致谢!费利佩

在此处输入图像描述

4

1 回答 1

3

Use smooth unique after the plot command.

From the gnuplot documentation:

The unique option makes the data monotonic in x; points with the same x-value are replaced by a single point having the average y-value. The resulting points are then connected by straight line segments.

Example

Without ordering

plot "-" with lines
 0   3
 2   4
-2   2
-5  -1
 1   5
 5   6
-1  -3
 4   0
-3  -3
 3  -4
-4   1
e

Result:

enter image description here

With ordering

plot "-" smooth unique with lines
 0   3
 2   4
-2   2
-5  -1
 1   5
 5   6
-1  -3
 4   0
-3  -3
 3  -4
-4   1
e

Result:

enter image description here

于 2013-08-15T23:30:22.853 回答