Discussion:
Squeezed Y direction output from multiplot
(too old to reply)
Shahid Maqbool
2022-06-16 14:04:34 UTC
Permalink
Dear all,

I am using this example to understand multiple plots on the same output. The souce site is:
http://gnuplot.sourceforge.net/demo_5.4/layout.html

The commands I am using are these

set multiplot layout 2,2 title "Multiplot layout" font ",14"
set xtics rotate
#
set title "Plot 1"
unset key
plot sin(x)/x
#
set title "Plot 2"
unset key
plot 'silver.dat' using 1:2 ti 'silver.dat'
#
set title "Plot 3"
unset key
plot sin(x)/x
#
set title "Plot 4"
unset key
plot 'silver.dat' using 1:2 ti 'silver.dat'
#
unset multiplot

The output is a bit squeezed in the y direction. Can anyone explain how to correct it? I want uniform x and y dimensions, a square domain is desirable, precisely. Thanks in advance!

Regards
Shahid
qrk
2022-06-17 01:46:29 UTC
Permalink
Set the output size to change aspect ratio.
Example:
set term qt 0 size 600,800

On Thu, 16 Jun 2022 07:04:34 -0700 (PDT), Shahid Maqbool
Post by Shahid Maqbool
Dear all,
http://gnuplot.sourceforge.net/demo_5.4/layout.html
The commands I am using are these
set multiplot layout 2,2 title "Multiplot layout" font ",14"
set xtics rotate
#
set title "Plot 1"
unset key
plot sin(x)/x
#
set title "Plot 2"
unset key
plot 'silver.dat' using 1:2 ti 'silver.dat'
#
set title "Plot 3"
unset key
plot sin(x)/x
#
set title "Plot 4"
unset key
plot 'silver.dat' using 1:2 ti 'silver.dat'
#
unset multiplot
The output is a bit squeezed in the y direction. Can anyone explain how to correct it? I want uniform x and y dimensions, a square domain is desirable, precisely. Thanks in advance!
Regards
Shahid
Jörg Buchholz
2022-06-17 07:08:45 UTC
Permalink
Post by Shahid Maqbool
Dear all,
http://gnuplot.sourceforge.net/demo_5.4/layout.html
The output is a bit squeezed in the y direction. Can anyone explain
how to correct it? I want uniform x and y dimensions, a square domain
is desirable, precisely. Thanks in advance!
Regards Shahid
If you want to have the same dimension of the graphs you must set the
margins. Example:

set margins 10,10,1,1
set multiplot layout 2,1
plot sin(x)
plot sin(x)+100
unset multiplot

Jörg
Shahid Maqbool
2022-06-17 16:41:23 UTC
Permalink
Post by Jörg Buchholz
Post by Shahid Maqbool
Dear all,
I am using this example to understand multiple plots on the same
http://gnuplot.sourceforge.net/demo_5.4/layout.html
The output is a bit squeezed in the y direction. Can anyone explain
how to correct it? I want uniform x and y dimensions, a square domain
is desirable, precisely. Thanks in advance!
Regards Shahid
If you want to have the same dimension of the graphs you must set the
set margins 10,10,1,1
set multiplot layout 2,1
plot sin(x)
plot sin(x)+100
unset multiplot
Jörg
It is still not working for the 2,2 multiplot, especially with the titles turned on.

Shahid
Jörg Buchholz
2022-06-22 05:51:51 UTC
Permalink
Post by Shahid Maqbool
Post by Jörg Buchholz
Post by Shahid Maqbool
Dear all,
I am using this example to understand multiple plots on the same
http://gnuplot.sourceforge.net/demo_5.4/layout.html
The output is a bit squeezed in the y direction. Can anyone explain
how to correct it? I want uniform x and y dimensions, a square domain
is desirable, precisely. Thanks in advance!
Regards Shahid
If you want to have the same dimension of the graphs you must set the
set margins 10,10,1,1
set multiplot layout 2,1
plot sin(x)
plot sin(x)+100
unset multiplot
Jörg
It is still not working for the 2,2 multiplot, especially with the titles turned on.
Shahid
With this example you get a 2*2 layout. One plot has a title with two
lines, one has no title and the other have titles with one line.
All have the same x and y dimension.

unset title
set margins 10,2,2,4
set ytics format "%.1f"
set multiplot
set size 0.5,0.5
set origin 0,0
plot sin(x)
set origin 0,0.5
set title "Plot\nTest"
plot sin(x)+100
set origin 0.5,0
set title "Plot"
plot sin(x)
set origin 0.5,0.5
set title "Plot"
plot sin(x)+100
unset multiplot

Jörg

Loading...