Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: sfeam Newsgroups: comp.graphics.apps.gnuplot Subject: Re: multiplot layout and changing size of canvas in EPS term Followup-To: comp.graphics.apps.gnuplot Date: Thu, 05 Jan 2012 19:39:46 -0800 Organization: gnuplot development team Lines: 138 Message-ID: References: <7e4b8a39-112d-473b-879b-706c0a996998@q17g2000yqh.googlegroups.com> Reply-To: sfeam@users.sourceforge.net Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit Injection-Date: Fri, 6 Jan 2012 03:39:48 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="3mhAfh4CeAIeL3OKnPexDA"; logging-data="6611"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Zl7iuFyiVoCradzyGml+r" User-Agent: KNode/4.4.9 Cancel-Lock: sha1:yVahLzX7rcbhnPxpFFYF9hCxwWE= Xref: x330-a1.tempe.blueboxinc.net comp.graphics.apps.gnuplot:823 Nicholas Musolino wrote: > I am a fairly advanced gnuplot user who would like to create a > multiplot figure using the layout option that includes 2 graphs, one > over the other. > > What I want is for both graphs to have the approximate size of the > "normal" non-multiplot graph. For example, I normally use "set size > 0.8,0.8" for single-graph (non-multiplot) figures. What I would like > is to have two graphs of this approximate size, with a total canvas > size of 0.8,1.6 times an ordinary canvas. I > > n fact, I think this should be the default behavior, rather than > compressing Nx1 figures into the original canvas; for example, see the > first figure showcased at > http://gnuplot.sourceforge.net/demo/layout.html, which isn't too > impressive. > > In older versions of GNUPLOT (3.8, 4.0), I would set origin, margin, > and graph size individually to make this all line up, using a BASH > script to create a gnuplot script. I had thought that this ugly > process would be over with gnuplot 4.4. > > Now, when I use multiplot layout after changing the canvas size in > gnuplot 4.4 patchlevel 3, the graphs do not expand to full canvas > size; rather, they remain their original "half-height" size, and only > take up half the canvas. > > To help illustrate this, I made an album of the pdf files (after > applying epstopdf) at http://imgur.com/a/zoKDV/all#0. Sorry for the > site's conversion to low-res PNG files. The first image in the album > is the "target"; I want to have two very similar (size and shape) > graphs stacked two-by-one. The second two images illustrate what > gnuplot produces with postscript term. > > Script follows; sorry for the leading whitespace; that's from a bash > script. > > Thanks in advance for any help/advice people can offer! > > set term postscript eps enhanced color > set size 1,2 There is probably the heart of the problem. For better or worse, starting in gnuplot version 4.2 the "set size" command cannot be used to enlarge the total output size from a terminal. In a nutshell, to change the size of the output from a terminal, append the desired "size" attribute to the terminal selection itself. If I understand your requirement correctly, you want: set term postscript eps enhanced color size 4in, 5.6in set multiplot layout 2,1 That gives you a total output size equal to 80% of two default size plots (5in x 3.5in) stacked on top of each other, and tells multiplot that in fact you do want two plots stacked on top of each other. You do not want to further compress the plot size within this space, so no "set size" command. > set multiplot layout 2,1 columnsfirst title "GEN $gen > CAND ${id}; {/Symbol f}_c = $phicut > deg" > > set style line 1 lt 1 lw 3 lc rgb > "red" > set style line 2 lt 3 lw 3 lc rgb > "black" > > set key > box; > > frandom(x) = > sin(x); > > set ylabel "probability > density" > > set xtics format "%. > 2f" > set xrange [0.0:pi/ > 2] > set mxtics > 4 > > # plot > 1 > set ytics format "%. > 1f" > set yrange [0.0:] > writeback > set mytics > 5 > > plot "${thetahistfile[E2]}" using 1:(\$4) with histeps > ls 1 title "observed distr., E2 sim.", > \ > frandom(x) with lines > ls 2 title "random distr." > > # plot > 2 > #set origin > 0,0.5 > set key > box; > set xlabel "aryl normal/aryl normal angle > (rad)" > set ylabel "probability > density" > > set xtics format "%. > 2f" > set xrange [0.0:pi/ > 2] > set mxtics > 4 > > > set ytics format "%. > 1f" > set yrange > restore > set mytics > 5 > > plot "${thetahistfile[E6]}" using 1:(\$4) with histeps > ls 1 title "observed distr., E6 sim.", > \ > frandom(x) with lines > ls 2 title "random distr." > > unset > multiplot