使用gnuplot对同一图形中的多个数据进行直方图分析

使用gnuplot对同一图形中的多个数据进行直方图分析,gnuplot,Gnuplot,我正在尝试使用gnuplot绘制两个数据系列,它们绘制在一个图形(直方图)中。一个是基线数据,另一个是优化的。脚本当前看起来像这样 n=50 max=0.07946462 min=0.0 reset width=(max-min)/n #interval width hist(x,width)=width*floor(x/width)+width/2.0 #function used to map a value to the interval

我正在尝试使用gnuplot绘制两个数据系列,它们绘制在一个图形(直方图)中。一个是基线数据,另一个是优化的。脚本当前看起来像这样

 n=50
    max=0.07946462
    min=0.0
    reset
    width=(max-min)/n #interval width
    hist(x,width)=width*floor(x/width)+width/2.0 #function used to map a value 
    to the intervals
    set term png #output terminal and file
    set output "histogram.png"
    set xrange [min:max]
    set yrange [0:]
    set style fill solid 0.5 #fillstyle
    set termopt enhanced    # turn on enhanced text mode
    set xlabel "PowerDensity(mA/um2)"
    set ylabel "Area(um2)"
    set title 'Power Density Histogram'
    plot 'power_density_oxili_sptp.txt' u (hist($2,width)):($1) smooth frequency 
    w boxes lc rgb"blue" title 'Baseline', 'power_density_oxili_sptp.txt' u 
    (hist($3,width)):($1) smooth frequency w boxes lc rgb"red" title 'Optimized'
这项研究的结果如下所示

这里的问题是,我无法完全看到基线数据(蓝色),因为它隐藏在优化数据下面。要么我需要同时看到这两个数据,要么我需要在同一个图表中分别绘制直方图。 溴
Sree

看起来您希望这两个直方图是透明的。为此,应在fillstyle中设置
透明
标志(请参见
帮助fillstyle
):

此外,您需要指定
truecolor
以从标准png终端获取透明区域(请参见
help png
):


或者,您可以使用
pngcairo
终端。

看起来您希望这两个直方图是透明的。为此,应在fillstyle中设置
透明
标志(请参见
帮助fillstyle
):

此外,您需要指定
truecolor
以从标准png终端获取透明区域(请参见
help png
):

或者,您可以使用
pngcairo
终端

set style fill transparent solid 0.5
set term png truecolor