Menu

#245 multiplot layout size

closed-out-of-date
nobody
None
5
2012-05-09
2009-09-01
Anonymous
No

It would be useful, if I can define the size of the multiplot layout. Now, the multiplot layout uses whole screen.
One example, where this is extremely useful:
> set multiplot layout 2,1
> plot sin(x)
> set xlabel "X value"
> plot cos(x)
> unset multiplot
This generates plot, where bottom graph is smaller than top graph... I need, that both graph have the same size If I fix the bmargin (before the multiplot), then the xlabel is out of the graph.

Write now it is possible, put it generates empty area below second graph.
> set bmargin 1.5
> set multiplot layout 3,1
> plot sin(x)
> set xlabel "X value"
> plot cos(x)
> unset multiplot

The scale and offset options in multiplot layout does not solve this problem

Discussion

  • Ethan Merritt

    Ethan Merritt - 2009-09-01

    The automatic layout in multiplot reserves the same space for each plot. If you draw equivalent plot into that space, then they will be the same size. If you add extra things (titles, axis labels, colorbar, etc) for one plot but not the others, then in order to make room for them that plot must necessarily become smaller.

    On the other hand, I think you were too quick to conclude that bmaring would not help you in this particular case. If you set bmargin correctly, then both plots will have the same size, and both will have the same amount of space underneath. But only one of them will have a label in that space.

     
  • Nobody/Anonymous

    I know gnuplot quite well... and as far as I know the following plot, without the empty area can not be made in gnuplot... unfortnunately. The plot commands are
    set bmargin 0.0
    set tmargin 0.0
    set multiplot layout 3,1
    set format x ""
    plot sin(x)
    set format x "%g"
    set xlabel "X value"
    plot cos(x)
    unset multiplot

    Most of the time I use postscript terminal (eps output) and I use fix_boundingbox command to remove the empty area around the graph. But it would be very nice, if I can do this directly in gnuplot.

    If I can define the multiplot layout size and origin, then for the previous plot I can use
    set multiplot layout 2,1 size 1.0,0.9 origin 0.0,0.1 and the multiplot take only upper part of the screen and small area bottom of the screen is for xlabel....
    If you know, how I can achieve this write now, please let me know... I know, that I can manually set the origin and size of each plot, but this is not nice solution...especially, if I have big layout.. e.g. layout 3,8. It is tedious to set the size and origin for each plot separately.

     
  • Ethan Merritt

    Ethan Merritt - 2012-05-09

    I'm going to close this as out of date. But in order to leave a useful trail for anyone searching on old problems, I've added a script below that achieves the requested effect using commands in recent versions of gnuplot.

    The "title" option reserve space at the top of the page.
    The "offset 0,0.08" option shifts all the plots upwards, so that part of the space reserved for the title is at the bottom rather than the top.

    set bmargin 0.0
    set tmargin 0.0
    set multiplot layout 2,1 title "Title on 1st of 4 lines\n\n\n\n" offset 0,.08
    set format x ""
    plot sin(x)
    set format x "%g"
    set xlabel "X value"
    plot cos(x)
    unset multiplot

     
  • Ethan Merritt

    Ethan Merritt - 2012-05-09
    • status: open --> closed-out-of-date
     

Log in to post a comment.

MongoDB Logo MongoDB