gnuplot从数据读取到绘制条形图

时间:2013-09-06 17:32:05

标签: subprocess gnuplot

我有一个包含两列的文件

9 5
10 3
11 0
12 25
13 50
14 80
etc

使用gnuplot绘制条形码的最佳方法是什么?使用子进程和gnuplot最好的方法是什么?理想情况下,图表应该是.pdf和png,因为我想稍后将它们放在网站上。

我非常感谢您的意见和建议。

1 个答案:

答案 0 :(得分:1)

以下是一个示例,如何使用绘图样式gnuplot

绘制带有with boxes的条形图
set terminal pngcairo size 1000,800 font ',12'
set output 'output.png'

set xlabel 'xlabel' font ',18'
set ylabel 'ylabel' font ',18'

set boxwidth 0.9 
set style fill solid 0.3

set offset 0.5, 0.5, 10, 0

plot 'data.txt' with boxes linewidth 3 title ''

根据您显示的数据,这将提供以下输出图像:

enter image description here