Gnuplot中不同组的不同条形用于打印 [英] Distinct bars of different group in Gnuplot for printing

查看:101
本文介绍了Gnuplot中不同组的不同条形用于打印的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对我来说,问题是如何在图形中绘制(使用gnuplot)不同样式的条形以便可以打印它们.

The problem for me is how plot (using gnuplot) bars with different styles in a figure so that they can be print.

http://www.ibm.com/developerworks中获取数据/aix/library/au-gnuplot/例如,数据为:

#Disk.txt
hdisk2 420 425 410
hdisk3 700 780 760
hdisk4 450 450 452
hdisk5 680 702 690
hdisk6 320 330 329
hdisk7 530 515 514

    #Gnuplot 

set terminal png truecolor
set output "diskimage.png"
set style data histograms
set style fill solid 1.00 border -1
plot "disk.txt"  using 2:xtic(1) title "Oct-09 data growth(gb)", '' using 3 title "N
ov-09 data growth(gb)", '' using 4 title "Dec-09 data growth(gb)"

gnuplot脚本起作用,并且条带用不同的颜色标记,以区分三个组.但是,一旦将其打印在纸上,颜色就会丢失,并且很难再区分条形了.

The gnuplot script works and bars are labelled with different colours for distinction of three groups. However, once it is print on the paper, the colours are lost and it is hard to distinct bars anymore.

我的问题是,是否可以针对不同的群体以不同的样式来绘制条形图.例如,不同组的填充条具有不同的填充样式?

My question is whether the bars can be plot with different style for different groups. E.g., Fill bars for different group with different filled style?

推荐答案

使用fillstyle pattern为每种条形选择不同的填充样式,使用lt -1(或lc rgb 'black')将黑色用作线条颜色:

Use fillstyle pattern to select between different fill patterns for each bar type, and lt -1 (or lc rgb 'black') to use black as line color:

set terminal pngcairo
set output "diskimage.png"
set style data histograms

plot 'Disk.txt' using 2:xtic(1) fs pattern 2 lt -1 title "Oct-09 data growth(gb)",\
     '' using 3 fs pattern 1 lt -1 title "Nov-09 data growth(gb)",\
     '' using 4 fs pattern 4 lt -1 title "Dec-09 data growth(gb)"

查看test命令的输出( Gnuplot线型)以检查可用填充所需输出端子的样式.

See the output of the test command (Gnuplot line types) to check the available fill patterns for the desired output terminal.

这篇关于Gnuplot中不同组的不同条形用于打印的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆