首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >缩短multiplot中的地块之间的距离

缩短multiplot中的地块之间的距离
EN

Stack Overflow用户
提问于 2012-02-08 11:55:05
回答 1查看 3.8K关注 0票数 3

我必须绘制一个包含两列和五行的多线图。我已经绘制了这些图,但我发现这些图之间的距离很大,我想减少它们。我使用了网站( http://www.gnuplot.info/demo_canvas/layout.html )中的最后一个示例编码(模板)。我试着调整上边距和下边距参数。如果我使用较小的值,x轴的标签就会消失,绘图之间的距离也会缩短。所以我必须使用大的值。我只是在想,有没有其他方法可以让情节更接近彼此?我已经给出了下面的图的代码,供您查看。我很高兴能在这个问题上获得一些见解。提前感谢

代码语言:javascript
复制
#!/usr/bin/gnuplot
  # SET TERMINAL
  set terminal postscript color enhanced "Arial" 10 #dashed lw 1 "Helvetica" 14     
  set output "plot-distribution-isoMalto-thermo.ps"

  # SET MACRO
  set macro
  labelFONT="font 'Arial,20'"
  scaleFONT="font 'Arial,14'"
  graph="using 1:2"
  axislabelFONT="font 'Arial,18' "
  #main_titleFONT="font 'times,14'"
  graphLabel="at 120,9000  font 'Arial,20' "
  position_orienation="at -50,18000 rotate right"

  color="linecolor rgb 'black' "
  layer1=" w l lt 1 lw 3 lc rgb 'black'"
  layer3=" w l lt 3 lw 3 lc rgb 'red' "
  layer2=" w l lt 2 lw 3 lc rgb 'green'"
  layer4=" w l lt 4 lw 3 lc rgb 'blue'"


  # SET MARGINS
  set tmargin 0.5
  set bmargin 4.0
  set lmargin 15
  set rmargin 3


  # SET RANGE
  set xrange [0:180]
  set yrange [0:12000]
  set xtics nomirror    0, 60, 180  @scaleFONT
  set ytics         0, 3000, 12000  @scaleFONT
  set format x ""

   #    MULTIPLOT START
  set multiplot layout 5, 2     #title "Multiplot layout 5, 2"
  set nokey

 #  PLOTTING STARTS
 #plot1
 #set title "Plot 1"
  set xtics nomirror
  set label 1 "(a)" @graphLabel
plot    "angle_output-thermo-malto-L1.dat" @layer1,\
    "angle_output-thermo-malto-L3.dat" @layer3
  #plot2
  #set title "Plot 2"
  set label 1 "(b)" @graphLabel
plot    "angle_output-thermo-malto-L2.dat" @layer2 ,\
    "angle_output-thermo-malto-L4.dat" @layer4


 #plot3
 #set title "Plot 3"
  set label 1 "(c)" @graphLabel
plot    "angle_output-thermo-bcmChain1-L1.dat" @layer1 ,\
    "angle_output-thermo-bcmChain1-L3.dat" @layer3
 #plot4
 #set title "Plot 4"
 set label 1 "(d)" @graphLabel
plot    "angle_output-thermo-bcmChain1-L2.dat" @layer2 ,\
    "angle_output-thermo-bcmChain1-L4.dat" @layer4




  #plot5
  #set title "Plot 5"
  set label 1 "(e)"     @graphLabel
 set label 2 "Distribution / N" @position_orienation @labelFONT
plot    "angle_output-thermo-bcmChain2-L1.dat" @layer1 ,\
    "angle_output-thermo-bcmChain2-L3.dat" @layer3
 #plot6
 #set title "Plot 6"
 set nolabel
 set label 1 "(f)" @graphLabel
plot    "angle_output-thermo-bcmChain2-L2.dat" @layer2 ,\
    "angle_output-thermo-bcmChain2-L4.dat" @layer4

 #plot7
 #set title "Plot 7"
 set label 1 "(g)" @graphLabel
plot    "angle_output-thermo-cello-L1.dat" @layer1 ,\
    "angle_output-thermo-cello-L3.dat" @layer3
  #plot8
  #set title "Plot 8"
  set label 1 "(h)" @graphLabel
plot    "angle_output-thermo-cello-L2.dat" @layer2 ,\
    "angle_output-thermo-cello-L4.dat" @layer4




   # for plot 9 and 10


  unset yrange
  set yrange [0:16000]
  set ytics 0, 4000, 16000
  set key

  #plot9
  #set title "Plot 9"
  set label 1 "(i)" @graphLabel
   set format x
plot    "angle_output-thermo-isomalto-L1.dat" @layer1 title "layer1",\
    "angle_output-thermo-isomalto-L3.dat" @layer3 title "layer3"

   #plot10
   #set title "Plot 10"
   set label 1 "(j)" @graphLabel
    set label "Angle in {/Symbol q} / deg" at -90,-8500 @labelFONT
    set format x
plot    "angle_output-thermo-isomalto-L2.dat" @layer2 title "layer2",\
    "angle_output-thermo-isomalto-L4.dat" @layer4 title "layer4"


   #    END MULTIPLOT
   unset multiplot
   #reset
   #pause -1
EN

回答 1

Stack Overflow用户

发布于 2012-03-26 22:35:09

我知道这是一个老生常谈的问题,但是可以使用set size来增加每个绘图的大小(也可以为每个绘图设置一个set origin )。否则,您最好的选择是使用set lmarginset rmarginset bmarginset tmargin

您可以使用set ?margin at ...设置相对于屏幕坐标的边距(与您放置的表单中的字符坐标相对)。这将允许您准确地将绘图放置在您想要的位置。请参阅http://gnuplot.sourceforge.net/demo/margins.html

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/9187651

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档