如何在gnuplot中标记90个百分点
如何在gnu图中标记90%。所需样品如何在gnuplot中标记90个百分点,gnuplot,Gnuplot,如何在gnu图中标记90%。所需样品 plot [][] "fle.txt" using 1:2 with lines 这就是我绘制图的方式,我想在图中标记90% 这是我的数据集 time(seconds) frequency cumulativeFrequency 10 2 2 11 6 8 12 8 16 13 10 26
plot [][] "fle.txt" using 1:2 with lines
这就是我绘制图的方式,我想在图中标记90%
这是我的数据集
time(seconds) frequency cumulativeFrequency
10 2 2
11 6 8
12 8 16
13 10 26
14 7 33
15 5 38
16 5 43
17 4 47
18 2 49
我看不出在gnuplot中单独实现这一点的任何方法,但是使用
python
--
你可以称之为:
python percent90.py path/to/datafile
这将告诉你在哪里放置标记。至于标记它,我可能会在gnuplot中这样做:
YVAL = `python percent90.py path/to/datafile`
set arrow 1 from graph 0,first YVAL to graph 1,first YVAL ls 1 nohead front
如果您只想计算90%的数据点,可以使用
stats
或plot
命令和gnuplot的内部变量,然后按照mgilson的建议画一条线:
#!/usr/bin/env gnuplot
set terminal png
set output 'test.png'
# 'every ::1' skips header
stats 'fle.txt' every ::1
mark = (STATS_max_y - STATS_min_y)*0.9 + STATS_min_y
set arrow 1 from graph 0,first mark to graph 1,first mark ls 1 nohead front
plot 'fle.txt' every ::1
此脚本生成以下输出:
您有哪个版本的gnuplot?此外,还不太清楚如何标记90%的标记。你只想在90%处画一条线,在x/y 90%的tic标记上做一个标签,以某种方式突出90%以上的点,还是别的什么?我对这个问题的解释不同。我以为OP想要的是90%的数据点都在这条线下,而不是90%的最大值点…我明白了。。。从措辞上讲有点难。
#!/usr/bin/env gnuplot
set terminal png
set output 'test.png'
# 'every ::1' skips header
stats 'fle.txt' every ::1
mark = (STATS_max_y - STATS_min_y)*0.9 + STATS_min_y
set arrow 1 from graph 0,first mark to graph 1,first mark ls 1 nohead front
plot 'fle.txt' every ::1