Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.graphics.apps.gnuplot > #1733

Re: Multiplot question

From Ingo Thies <ingo.thies@gmx.de>
Newsgroups comp.graphics.apps.gnuplot
Subject Re: Multiplot question
Date 2013-03-26 15:57 +0100
Message-ID <ardr9rF4ocjU1@mid.individual.net> (permalink)
References <kirps0$4b7$1@dont-email.me>

Show all headers | View raw


Am 26.03.2013 10:30, schrieb Dieter Britz:
> I have the following multiplot (stripped of
> labelling etc)
>
> set size square
> set multiplot layout 1, 2
> plot 'vb.dat' w l lt 1, 'vbp.dat' w p pt 7 ps 1
> plot 'rz.dat' w l lt 1, 'rzp.dat' w p pt 7 ps 1
>
> This produces two plots, both square, side by side,
> and the same size.
>
> However, I would like the right-hand one stretched
> in the x-direction by a factor, but to keep its
> vertical height.
>
> How do I do that please?
>

You get the highest degree of freedom by setting the margins in screen 
coordinates

set lmargin screen num1
set rmargin screen num2
set bmargin screen num3
set tmargin screen num4

where num1...num4 are numbers between 0 and 1 marking the *absolute* 
positions of the graph borders (*not* the margin width in this case). 
This requires a little bit of math to get the dimensions correct, since 
the shape of each plots depends on both the margin coordinates and the 
canvas (screen) dimensions.

Example: let the aspect x:y ratio of the plotting canvas be 9:4, e.g. 
1125x500 (these pixel numbers give convenient round values in this 
example). Then the following settings will give a square graph left and 
a 6:5 graph

set multiplot

set lmargin screen 0.05 # first plot spans 0.4*1125 = 450 pixels
set rmargin screen 0.45 # in width
set bmargin screen 0.05 # and 0.9*500 = 450 pixels
set tmargin screen 0.95 # in height, => square

plot 'vb.dat' w l lt 1, 'vbp.dat' w p pt 7 ps 1

set lmargin screen 0.50 # width now 0.48*1125 = 540 pixels
set rmargin screen 0.98 # in width
set bmargin screen 0.05 # but the same pixel numer
set tmargin screen 0.95 # in height

plot 'rz.dat' w l lt 1, 'rzp.dat' w p pt 7 ps 1

Since you can use variables for the numbers, you can define the relevant 
math in your plotting script to scale it arbitrarily. I have done a 
similar thing for regular plotting panels, but this won't be of much 
help in your case.

HTH

Best wishes,

Ingo

Back to comp.graphics.apps.gnuplot | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Multiplot question Dieter Britz <dieterhansbritz@gmail.com> - 2013-03-26 09:30 +0000
  Re: Multiplot question Karl <mail.kfr@gmx.net> - 2013-03-26 14:21 +0100
    Re: Multiplot question Dieter Britz <dieterhansbritz@gmail.com> - 2013-03-26 13:35 +0000
  Re: Multiplot question Ingo Thies <ingo.thies@gmx.de> - 2013-03-26 15:57 +0100
    Re: Multiplot question Dieter Britz <dieterhansbritz@gmail.com> - 2013-04-04 09:01 +0000
      Re: Multiplot question sfeam <sfeam@users.sourceforge.net> - 2013-04-04 12:08 -0700
        Re: Multiplot question Dieter Britz <dieterhansbritz@gmail.com> - 2013-04-05 08:44 +0000
  Re: Multiplot question Christoph Bersch <usenet@bersch.net> - 2013-03-26 15:57 +0100

csiph-web