Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

change size and orientation of an output graph in epslatex (multiplot-mode)

800 views
Skip to first unread message

bbcda

unread,
Mar 11, 2010, 11:45:16 AM3/11/10
to
Dear all,


I have posted here before - but, although I have use Gnuplot several
times during the last years, I am stil far from being an expert...
Currently I am having a problem with switching my graph into portrait
mode.

I use epslatex as my terminal, and multiplot to set different plots
onto the graph. I want to use the plots in Latex, of course, on letter
size paper - and thus would like to have the plots in portrait-mode,
and with a clearly defined size (lets say: 13 x 20 cm). Currently, I
could only get portrait orientation by setting the size of the overall
output (I used 0.5, 1 for the moment), and using only the half size of
the area that gnuplot offers. However, I find this quite odd, and
currently don't know if this is the best solution for this problem;
actually, I think that it would be much easier to change the
orientation of the graph from landscape (which seems standard in
gnuplot) to portrait; however, I can't find a way how to do that.
Additionally, it would be nice to precisely define the size of the
output eps (its boundary box); even here, I couldn't find out how.

Here is a short version of what I am currently using as a Gnuplot input
file; as You cann see, I am currently setting the dimension of the
overall graph using the "set size" at the beginning of the document,
and then organize all my plots in the multiplot-environment using "set
size" and "set origin" accordingly, avoiding to use the right-hand size
of the graphing area, which is cut away by my "set size 0.5, 1"-command
at the very beginning:


set terminal epslatex
set size .5,1
set output "out.tex"

set multiplot title "plot"

set xtics axis

set size 0.3,0.27
set origin 0,0.70
set noytics
plot "data1.txt" with lines title "data1"

set size 0.2,0.27
set origin 0.3,0.70
plot "data2.txt" with lines title "data 2"

set size 0.5,0.20
set bmargin 0
set format x ""
set origin 0,0.5
plot "data3" using 1:2 with boxes title "data 3"

set origin 0,0.3
set tmargin 0
plot "data3.txt" using 1:3 with boxes title "data 4"

set origin 0,0.1
set format x "%g"
plot "data3.txt" using 1:($2-$3) with boxes title "residuum"

unset multiplot

My question now: does anyone here have a hint for me how to solve this
and do this more elegantly - e.g. simply switch Gnuplot into portrait
orientation? It seems to produce outputs in landscape orientation by
default (which is fine for most simple plots - but not my multiplot
task here). Additionally, setting all dimensions myself kind of screws
up the epslatex output, as said - and it makes some of the labels (such
as the multiplot title) appear in thew wrong position... I think, if
there were a way to set Gnuplot into portrait orientation, it would
make things much easier (epslatex and multiplot do not seem to
cooperate without problems). I am using Gnuplot 4.4 Release Candidate.

Thanks everyone once again for Your considerations!!! With kind regards,
Björn

bbcda

unread,
Mar 11, 2010, 11:54:44 AM3/11/10
to
sorry - it just occurred to me that I should make some additions:

What I really want to do is to prepare many different epslatex plots
using such Gnuplot scripts, and include them in Latex. Each of those
plots should fill one letter-sized page in the Latex document
(including its Latex Graphic-craption). This is why I asked how to
define the size of the eps document that Gnuplot outputs (i.e., the
size of the eps boundary box). I think that this should be standard in
Gnuplot... however, it seems that I can't control the absolute size (in
physical dimensions, e.g. measured in centimeters) of the output...
Maybe I am still just confused by the complicate interplay of
multiplot, epslatex and latex...

Thanks again to You all! Best,
Björn

Stefan Nowy

unread,
Mar 11, 2010, 11:55:36 AM3/11/10
to
bbcda wrote:

> I use epslatex as my terminal, and multiplot to set different plots onto
> the graph. I want to use the plots in Latex, of course, on letter size
> paper - and thus would like to have the plots in portrait-mode, and with
> a clearly defined size (lets say: 13 x 20 cm).

Something like this?

reset
set term epslatex color size 13cm,20cm

set lmargin at screen 0.1
set bmargin at screen 0.1
set rmargin at screen 0.9
set tmargin at screen 0.9

set output "out.tex"
plot sin(x) with lines title "a nice sine"
set output

HTH,
Stefan

bbcda

unread,
Mar 11, 2010, 12:25:05 PM3/11/10
to
Hey, Stefan!

> Something like this?
>
> reset
> set term epslatex color size 13cm,20cm


Something like that, right! :-D Unbelievable! I thought I tried it
before... I think I just got entangled in all the possible options etc.
- and didn't see this way :-D Thanks a lot - that was all I needed!!!
Great!

Best,
Björn

jah...@gmail.com

unread,
Mar 17, 2010, 4:39:34 AM3/17/10
to
Hurray! But what about the misplaced titles with multiplot - any
solutions besides using small fonts?
Thanks, Jeremy

bbcda

unread,
Mar 19, 2010, 12:14:47 AM3/19/10
to
Hey, Jeremy!


Sorry - see Your reply just now... so busy producing plots :-D
Are You using Multiplot and still experience problems with those
misplaced titles? To be honest, I remember that I once had that problem
when I was playing around with the multiplot setup (shortly before I
wrote my original post - and I figured that that trouble might be an
indicator that I did someting completely odd) - but I don't remember
what exactly I was trying there... might have been something very
bizarre (scaling things)... In fact, the simple solution Stefan
suggested (simply adding the size to the "set terminal" directive at
the beginning of the gnuplot script, such as "set term epslatex color
size 13cm,20cm") helped - and in that fashion, all items are placed
well within my EPSLatex document... I deleted all my tries then... so,
currently I can't reproduce that behaviour, and it might need a lot of
research on my side to find out how I did it - and reproduce it...

Do You have any trouble? If so, I can send You one of my input files...

Best,
Björn

0 new messages