在gnuplot中的集群条形图

sfa*_*tor 20 plot gnuplot bar-chart

我有一个简单的结果表,我想在gnuplot中绘制为聚类直方图.数据集具有网页的内容类型类别以及两列中的相应百分比份额.我有两个浏览器.例如,

For IE,
    Content      Share
    Video         30%
    Audio         10%
    Flash         25%
    HTML          20%
    Javascript    15%

   For Chrome,
    Content      Share
    Video         20%
    Audio         5%
    Flash         35%
    HTML          30%
    Javascript    10%
Run Code Online (Sandbox Code Playgroud)

现在我想将这两个数据与x轴中的内容类型以及带有图例的y轴上的相应共享一起绘制.我该怎么做呢?

Mat*_*att 38

如果将数据转换为表格,则相对容易.

info.dat 应包含:

Broswer Video   Audio   Flash   HTML    JavaScript
IE      30%     10%     25%     20%     15%
Chrome  20%     5%      35%     30%     10%
Run Code Online (Sandbox Code Playgroud)

然后使用类似的东西:

set terminal pdf enhanced
set output 'bar.pdf'

set style data histogram
set style histogram cluster gap 1

set style fill solid border rgb "black"
set auto x
set yrange [0:*]
plot 'info.dat' using 2:xtic(1) title col, \
        '' using 3:xtic(1) title col, \
        '' using 4:xtic(1) title col, \
        '' using 5:xtic(1) title col, \
        '' using 6:xtic(1) title col
Run Code Online (Sandbox Code Playgroud)

创建你的情节.这是我之前制作的一个:集群条形图