gnuplot: stacked newhistogram, starting with same fillstyle pattern, not appearing in shared key

半世苍凉 提交于 2019-12-07 17:17:07

问题


I am trying to create multiple columnstacked histograms in gnuplot using the newhistogram command. The data share the same structure so I want the boxes to share the same key like in this question, but with a pattern fillstyle (not only color).

My script looks like this:

set style data histogram
set style histogram columnstacked
set style fill pattern
set boxwidth 0.75
set xtics ("fff" 0, "ggg" 1, "hhh" 3, "iii" 4)
set grid y
set border 3 # remove top and right plot-border

set key outside title 'key' width -30

plot \
newhistogram "data A" fs pattern 2 lt 1, \
"plot_test_data.out" u 2, '' u 3, \
newhistogram "data B" fs pattern 2 lt 1, \
"plot_test_data_2.out" u 2:key(1), '' u 3

which produces the following output:

Could anybody explain why the key doesn't show the correct pattern? (I tried adding fs pattern in each using directive and removing the linetype, but nothing bears the desired output).

I am using

G N U P L O T Version 4.6 patchlevel 3
last modified 2013-04-12 Build System: Linux x86_64

with 2 test data sets

plot_test_data.out:

0 1 3 2 2
1 1 6 4 4 
2 2 5 4 5
3 1 1 3 4
4 1 2 4 5

plot_test_data_2.out:

0 1 4 3 1 
1 3 6 4 2 
2 2 5 6 4
3 2 5 5 3
4 1 3 4 2

thank you!

来源:https://stackoverflow.com/questions/28480095/gnuplot-stacked-newhistogram-starting-with-same-fillstyle-pattern-not-appeari

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!