并排放置直方图 [英] Put histogram side-by-side
本文介绍了并排放置直方图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想对一个堆叠在gnuplot中的直方图进行分组,类似于此图像:
I want to group an histogram rowstacked in gnuplot similar to this image:
我有这2个文件,直方图的数据来自:
I have these 2 files where the data from the histogram comes from:
#Round-robin
Input West-Virginia ChicagoI ChicagoII California
1500 28 25 28 19
3000 30 24 25 21
4500 28 28 25 19
6000 34 25 23 18
#Min-makespan
Input West-Virginia ChicagoI ChicagoII California
1500 34 20 30 17
3000 33 30 21 16
4500 31 23 38 9
6000 42 21 38 0
plot for [i=2:5] 'cloudusage-roundrobin.dat' using i:xtic(1), \
for [i=2:5] 'cloudusage-minmakespan.dat' using i:xtic(1)
1-我的绘图指令将两个直方图堆叠在一起,而不是并排放置.如何将它们与2 xx标签并排放置?
1 - My plot instruction stack both histograms, instead of having them side-by-side. How I put them side-by-side, and also with the 2 xx labels ?
推荐答案
您必须使用newhistogram
来开始新的直方图.为了使用相同的线型,必须给第二次调用newhistogram
选项lt 1
:
You must use newhistogram
to start a new histogram. In order to use the same linetype, you must give the second call to newhistogram
the option lt 1
:
reset
set style data histogram
set style histogram rowstacked title offset 0,-1
set bmargin 4
set boxwidth 0.9
set style fill solid border lt -1
set key autotitle columnheader horizontal
plot newhistogram 'Cluster 1', \
for [i=2:5] 'cloudusage-roundrobin.dat' using i:xtic(1),\
newhistogram 'Cluster 2' lt 1, \
for [i=2:5] 'cloudusage-minmakespan.dat' using i:xtic(1) notitle
4.6.4的结果:
这篇关于并排放置直方图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文