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

Sizing one plot in a multiplot differently

103 views
Skip to first unread message

chris...@gmail.com

unread,
Feb 5, 2013, 10:04:56 AM2/5/13
to
Hi there,

I attached the gnuplot file illustrating my problem below. It shows four 2-dim plots one below the other. The first three are similar in dimensions but illustrate different data. The fourth one illustrates something else, and the y-axis is not high enough in order to display the labelling correctly. At the same time, there's too much space on the very bottom of the multiplot layout. My question: is there any chance to increase the height of the fourth plot, such that it occupies the remaining space or at least displays the y-axis labelling correctly?

Thanks a lot for your help!

Best,
Christian

--
#Agent/resource state gradient
#Automatically generated gnuplot script file
reset
#set terminal epslatex color size 5,8
#set output 'plots/gradient_s0_h1_greedy.tex'
set multiplot layout 5, 1
set tmargin 0
set bmargin 0
set lmargin 10
set rmargin 5
set grid front
set style rect fc rgb 'light-green' fs solid 0.3 noborder back
unset xlabel
set xrange [0:25]
set xtics 1
set format x ''
set yrange [0:4]
set ytics 0,1,3
set ylabel '$X_t$'
set grid
set y2label 'Agent 0'
unset object
set object rect from 1,0 to 2,4
set object rect from 4,0 to 5,4
set object rect from 7,0 to 8,4
set object rect from 10,0 to 11,4
set object rect from 13,0 to 14,4
set object rect from 16,0 to 17,4
set object rect from 19,0 to 20,4
set object rect from 22,0 to 23,4
plot '-' using 1:2 lc rgb '#8A2BE2' title 'agent state gradient' with linespoints
1 1
2 2
3 2
4 2
5 2
6 2
7 2
8 2
9 2
10 2
11 1
12 1
13 1
14 2
15 2
16 2
17 2
18 2
19 2
20 1
21 1
22 1
23 2
24 2
25 2
e
set y2label 'Agent 1'
unset object
set object rect from 2,0 to 3,4
set object rect from 5,0 to 6,4
set object rect from 8,0 to 9,4
set object rect from 11,0 to 12,4
set object rect from 14,0 to 15,4
set object rect from 17,0 to 18,4
set object rect from 20,0 to 21,4
set object rect from 23,0 to 24,4
plot '-' using 1:2 lc rgb '#DC143C' title 'agent state gradient' with linespoints
1 1
2 1
3 2
4 2
5 2
6 2
7 2
8 2
9 2
10 2
11 2
12 2
13 2
14 2
15 1
16 1
17 1
18 2
19 2
20 2
21 2
22 2
23 2
24 1
25 1
e
set y2label 'Agent 2'
unset object
set object rect from 3,0 to 4,4
set object rect from 6,0 to 7,4
set object rect from 9,0 to 10,4
set object rect from 12,0 to 13,4
set object rect from 15,0 to 16,4
set object rect from 18,0 to 19,4
set object rect from 21,0 to 22,4
set object rect from 24,0 to 25,4
plot '-' using 1:2 lc rgb '#DAA520' title 'agent state gradient' with linespoints
1 1
2 1
3 1
4 2
5 2
6 2
7 1
8 1
9 1
10 2
11 2
12 2
13 2
14 2
15 2
16 1
17 1
18 1
19 2
20 2
21 2
22 2
23 2
24 2
25 2
e
set yrange [0:13]
set grid
set format x
set xlabel 't'
set ylabel '$R_t$'
set y2label 'Resource'
set xtics 0,1,25
set ytics 0,1,12
unset object
plot '-' using 1:2 title 'resource state gradient' with linespoints
0.5 0
1 2
1.5 0
2 2
2.5 0
3 2
3.5 0
4 2
4.5 0
5 2
5.5 0
6 2
6.5 2
7 4
7.5 2
8 4
8.5 2
9 4
9.5 2
10 4
10.5 4
11 6
11.5 4
12 6
12.5 4
13 6
13.5 4
14 6
14.5 6
15 8
15.5 8
16 10
16.5 8
17 10
17.5 8
18 10
18.5 8
19 10
19.5 10
20 12
20.5 10
21 12
21.5 10
22 12
22.5 10
23 12
23.5 12
24 12
24.5 10
e
unset multiplot

sfeam

unread,
Feb 5, 2013, 1:19:21 PM2/5/13
to
chris...@gmail.com wrote:

> Hi there,
>
> I attached the gnuplot file illustrating my problem below. It shows four
> 2-dim plots one below the other. The first three are similar in dimensions
> but illustrate different data. The fourth one illustrates something else,
> and the y-axis is not high enough in order to display the labelling
> correctly. At the same time, there's too much space on the very bottom of
> the multiplot layout. My question: is there any chance to increase the
> height of the fourth plot, such that it occupies the remaining space or at
> least displays the y-axis labelling correctly?

I don't see anything wrong with the y-axis labeling, so I can't help you there.
As to filling up the remaining space - add the following command
just prior to the final "plot" command

set bmargin at screen 0.05

That will override the automatic calculation of the lower plot boundary.

Ethan

chris...@gmail.com

unread,
Feb 6, 2013, 6:53:54 AM2/6/13
to sf...@users.sourceforge.net
Dear Ethan,

thanks for your reply and the first great hint. I highlighted (red) the bad-labelled y-axis in this screenshot. What I want is to increase the highlighted plot in height.

http://img607.imageshack.us/img607/313/gnuplotex.jpg

Thanks,
Christian

Jörg Buchholz

unread,
Feb 6, 2013, 8:19:08 AM2/6/13
to
On 06.02.2013 12:53, chris...@gmail.com wrote:
>
> thanks for your reply and the first great hint. I highlighted (red)
> the bad-labelled y-axis in this screenshot. What I want is to
> increase the highlighted plot in height.
>
> http://img607.imageshack.us/img607/313/gnuplotex.jpg

do you looking for something like this?

set format x ''
set multiplot
set tmargin 0
set bmargin 0
set lmargin 10
set rmargin 5
set size 1,0.2
set origin 0,0.78
plot cos(x)
set origin 0,0.58
plot sin(x)
set origin 0,0.38
plot cos(x)
set format x
set size 1,0.30
set origin 0,0.08
plot cos(x)
unset multiplot


J�rg B.

sfeam

unread,
Feb 6, 2013, 2:27:58 PM2/6/13
to
chris...@gmail.com wrote:

> On Tuesday, February 5, 2013 7:19:21 PM UTC+1, sfeam wrote:
>> chris...@gmail.com wrote:
>> My question: is there any chance to increase the
>> > height of the fourth plot, such that it occupies the remaining space or
>> > at
>>
>> > least displays the y-axis labelling correctly?
>>
>> I don't see anything wrong with the y-axis labeling, so I can't help you
>> there.
>>
>> As to filling up the remaining space - add the following command
>>
>> just prior to the final "plot" command
>>
>> set bmargin at screen 0.05
>>
>> That will override the automatic calculation of the lower plot boundary.
>>
>> Ethan
>>

> Dear Ethan,
>
> thanks for your reply and the first great hint. I highlighted (red) the
> bad-labelled y-axis in this screenshot. What I want is to increase the
> highlighted plot in height.
>

Yes, I got that part. The command I gave above will do so.
See also the final plot in

http://gnuplot.sourceforge.net/demo_cvs/layout.html

>
> http://img607.imageshack.us/img607/313/gnuplotex.jpg

I don't really think you can call that "bad labelling".
You could either make the axis tics more sparse
set ytics 2

or reduce the font size
set ytics font ",10"

or, as you asked, increase the vertical space allocated to the plot.



> Thanks,
> Christian

0 new messages