如何使用行堆叠选项在gnuplot中绘制两个脉冲图?

如何使用行堆叠选项在gnuplot中绘制两个脉冲图?,plot,gnuplot,Plot,Gnuplot,我正在尝试绘制冲动图,这是我当前的脚本: set terminal pngcairo transparent enhanced font "arial,10" fontscale 1.0 size 500, 350 set output 'test.png' set key bmargin left horizontal Right noreverse enhanced autotitles box linetype -1 linewidth 1.000 plot 'example.csv'

我正在尝试绘制冲动图,这是我当前的脚本:

set terminal pngcairo transparent enhanced font "arial,10" fontscale 1.0 size 500, 350 
set output 'test.png'
set key bmargin left horizontal Right noreverse enhanced autotitles box linetype -1 linewidth 1.000
plot 'example.csv' using 2:xtic(1) title col with impulses lw 15, \
                '' using 3:xtic(1) title col with impulses lw 15, \
                '' using 4:xtic(1) title col with impulses lw 15
数据输入为:

var basis out1 out2
param1 0.1 0.3 0.5 
param2 -0.1 0.4 -0.6 
param3 0.4 0.6 0.8 
param4 -0.4 -0.5 -0.6 
param -0.1 0.0 0.1 
这是电流输出:

gnuplotexample.gnu

因此,我尝试将条形图堆叠在一个类似于直方图选项的行位置(
set style histogram rowstacked
),但没有成功

我想要的直方图示例如下:


脉冲图也有类似的功能吗?

如果你想要一个行堆叠的直方图,为什么不干脆用一个呢?与

set style data histogram
直方图
设置为所有打印的全局打印样式,并使用

set style histogram rowstacked clustered
您可以得到一行中所有值的聚类。一个完整的示例脚本(带有一些视觉增强功能)是:

与输出


谢谢你的回答。我需要一个类似于rowstacked的选项,但我需要的是列的条(basis、out1和out2)并排显示,类似于示例。在回答中,您对直方图使用了选项
set xzeroaxis
,这将非常有助于满足我的需要。再次感谢。然后您必须绘制一个
直方图,请参阅我的更新。
reset
set style data histogram
set style histogram rowstacked clustered gap 2
set boxwidth 0.9 relative
set style fill solid noborder
set key auto columnheader tmargin horizontal Right
set xzeroaxis
plot for [i=2:4] 'example.csv' u i:xtic(1)