每个地块的gnuplot多点等高

每个地块的gnuplot多点等高,plot,gnuplot,height,equals,Plot,Gnuplot,Height,Equals,我想制作一个gnuplot多点图,上面有三个图。到目前为止,当我不添加x轴标签并将每个tmargin和bmargin设置为相等时,它起到了作用。但是,当我在最低的绘图下面添加一个x轴标签und xtics时,该绘图的高度会缩小,如图所示。您知道如何在最低的绘图下方使用x轴标签绘制大小相等的绘图吗 这是我的代码: reset set lmargin 9 set rmargin 3 unset key set xrange [-1:41] set boxwidth 0.4 set style

我想制作一个gnuplot多点图,上面有三个图。到目前为止,当我不添加x轴标签并将每个tmargin和bmargin设置为相等时,它起到了作用。但是,当我在最低的绘图下面添加一个x轴标签und xtics时,该绘图的高度会缩小,如图所示。您知道如何在最低的绘图下方使用x轴标签绘制大小相等的绘图吗

这是我的代码:

reset

set lmargin 9
set rmargin 3
unset key

set xrange [-1:41]

set boxwidth 0.4
set style fill solid noborder

set multiplot layout 3,1

set xtics format ""
set xtics 5
unset xlabel
set ytics 100
set logscale y
set format y "10^{%L}"

set key ins vert right top
set tmargin 0.8
set bmargin 0.5
set yrange [1:100000000]
#set ylabel "Photonen / s  [Mio.]" offset 0,0,0 font ""
plot "300sLinienMit0.txt" u (($1)):($2/300) w boxes lc rgb "#6699ff" title "185,72 keV"

set xtics format ""
unset xlabel

set ytics 10
set tmargin 0.5
set bmargin 0.5
set yrange [1:1000]
set ylabel "Photonen [s^{-1}]" offset -2,0,0 font ""
plot "300sLinienMit0.txt" u ($1):($3/300) w boxes lc rgb "#ff6600" title "351,03 keV"
unset ylabel

set xtics format ""
unset xlabel

set tmargin 0.5
set yrange [1:1000]
set format x "%g"

set xtics 5 offset 0,0,0
set bmargin 3.5
set xlabel "Blei-Abschirmung [mm]" offset 0,0,0 font "" 
#set ylabel "Photonen / s  [Tsd.]" offset 0,0,0 font ""
plot "300sLinienMit0.txt" u ($1):($4/300) w boxes lc -1 title "831,98 keV"

unset multiplot

您必须在多点打印环境中自行设置(子)打印的位置和大小。 重要的是
设置bmargin 0
。通过
设置原点0,myBottomMargin
设置的底部打印的边距。然后相应地设置其他绘图的原点和大小。我希望下面的代码是自我解释的

代码:

### multiplot with equal plot heights
reset session

myBottomMargin = 0.15
myPlotHeight = (1. - myBottomMargin)/3

set multiplot

    set xlabel "This is the xlabel for all plots"
    set ytics 0.5
    set grid xtics, ytics
    set origin 0, myBottomMargin
    set size 1, myPlotHeight
    set bmargin 0
    set label 1 at graph 1.0, graph 1.0 "185.72 keV" right offset -1,-1
    plot sin(x) w l lc 1 notitle
    
    unset xlabel
    set format x ""
    set origin 0, myBottomMargin+myPlotHeight
    set label 1 at graph 1.0, graph 1.0 "351.03 keV" right offset -1,-1
    plot sin(2*x) w l lc 2 notitle
    
    set origin 0, myBottomMargin+2*myPlotHeight
    set label 1 at graph 1.0, graph 1.0 "831.98 keV" right offset -1,-1
    plot sin(3*x) w l lc 3 notitle

unset multiplot
### end of code
结果:

### multiplot with equal plot heights
reset session

myBottomMargin = 0.15
myPlotHeight = (1. - myBottomMargin)/3

set multiplot

    set xlabel "This is the xlabel for all plots"
    set ytics 0.5
    set grid xtics, ytics
    set origin 0, myBottomMargin
    set size 1, myPlotHeight
    set bmargin 0
    set label 1 at graph 1.0, graph 1.0 "185.72 keV" right offset -1,-1
    plot sin(x) w l lc 1 notitle
    
    unset xlabel
    set format x ""
    set origin 0, myBottomMargin+myPlotHeight
    set label 1 at graph 1.0, graph 1.0 "351.03 keV" right offset -1,-1
    plot sin(2*x) w l lc 2 notitle
    
    set origin 0, myBottomMargin+2*myPlotHeight
    set label 1 at graph 1.0, graph 1.0 "831.98 keV" right offset -1,-1
    plot sin(3*x) w l lc 3 notitle

unset multiplot
### end of code

哇!完美的非常感谢:)现在唯一的一件事是,我不希望钥匙上有符号,只要一个数字。有什么想法吗?谢谢你的补充。这样,键符号不可见,但数字(例如“185,72”)仍处于与之前相同的位置。当它右对齐时会更漂亮,就像我上面图片中的符号一样。有没有人知道如何删除键中的符号,从而使绘图标题在右上角对齐?我在gnuplot 5.2手册(5.2版由Ethan A Merritt和许多其他人组织)的第62页上发现了一个绘图,其中键只有一个文本,没有符号,但没有显示脚本-我仍然不知道如何操作,但这是可能的!如果只想在每个绘图的右上角有一个数字,可以使用
设置标签
。检查帮助标签。始终使用
标签1
覆盖上一个标签。我将修改这个示例。@pablobanano这是否回答了您的问题?欢迎您的回复。