Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.graphics.apps.gnuplot > #823
| From | sfeam <sfeam@users.sourceforge.net> |
|---|---|
| Newsgroups | comp.graphics.apps.gnuplot |
| Subject | Re: multiplot layout and changing size of canvas in EPS term |
| Followup-To | comp.graphics.apps.gnuplot |
| Date | 2012-01-05 19:39 -0800 |
| Organization | gnuplot development team |
| Message-ID | <je5qe4$6ej$1@dont-email.me> (permalink) |
| References | <7e4b8a39-112d-473b-879b-706c0a996998@q17g2000yqh.googlegroups.com> |
Followups directed to: comp.graphics.apps.gnuplot
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
Back to comp.graphics.apps.gnuplot | Previous | Next — Previous in thread | Next in thread | Find similar
multiplot layout and changing size of canvas in EPS term Nicholas Musolino <n.musolino@gmail.com> - 2012-01-05 17:26 -0800
Re: multiplot layout and changing size of canvas in EPS term sfeam <sfeam@users.sourceforge.net> - 2012-01-05 19:39 -0800
Re: multiplot layout and changing size of canvas in EPS term Nicholas Musolino <n.musolino@gmail.com> - 2012-01-06 02:57 -0800
Re: multiplot layout and changing size of canvas in EPS term Nicholas Musolino <n.musolino@gmail.com> - 2012-01-09 11:32 -0800
csiph-web