我正在尝试使用gnuplot从此数据文件中生成以下直方图集群,其中每个类别在数据文件中每年以单独的行表示:
# datafile
year category num_of_events
2011 "Category 1" 213
2011 "Category 2" 240
2011 "Category 3" 220
2012 "Category 1" 222
2012 "Category 2" 238
...
Run Code Online (Sandbox Code Playgroud)

但我不知道怎么做每个类别一行.如果有人知道如何使用gnuplot,我会很高兴.
更好的是如下所示的堆叠直方图集群,其中堆叠的子类别由数据文件中的单独列表示:
# datafile
year category num_of_events_for_A num_of_events_for_B
2011 "Category 1" 213 30
2011 "Category 2" 240 28
2011 "Category 3" 220 25
2012 "Category 1" 222 13
2012 "Category 2" 238 42
...
Run Code Online (Sandbox Code Playgroud)

非常感谢提前!