Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  nodelist  faq  login

All programmers are playwrights and all computers are lousy actors.


computers / comp.graphics.apps.gnuplot / Legend behavior would multiplot

SubjectAuthor
* Legend behavior would multiplotDarby
+- Re: Legend behavior with multiplotDarby
+- Re: Legend behavior would multiplotJörg_Buchholz
`- Re: Legend behavior would multiplotJörg_Buchholz

1
Subject: Legend behavior would multiplot
From: Darby
Newsgroups: comp.graphics.apps.gnuplot
Date: Tue, 14 Apr 2020 20:43 UTC
X-Received: by 2002:a37:4a88:: with SMTP id x130mr23196945qka.247.1586897036431;
Tue, 14 Apr 2020 13:43:56 -0700 (PDT)
X-Received: by 2002:aca:d503:: with SMTP id m3mr16123804oig.165.1586897035951;
Tue, 14 Apr 2020 13:43:55 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder7.news.weretis.net!feeder5.feed.usenet.farm!feed.usenet.farm!newsfeed.xs4all.nl!newsfeed9.news.xs4all.nl!82.197.223.106.MISMATCH!feeder1.cambriumusenet.nl!feed.tweak.nl!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.graphics.apps.gnuplot
Date: Tue, 14 Apr 2020 13:43:55 -0700 (PDT)
Complaints-To: groups-abuse@google.com
Injection-Info: google-groups.googlegroups.com; posting-host=156.68.247.42; posting-account=KFhoNQoAAADZ5hYjCa2RcH8TjbhfoFQl
NNTP-Posting-Host: 156.68.247.42
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <3095ba79-70e8-4f1d-9c1f-c2f2b7561b3f@googlegroups.com>
Subject: Legend behavior would multiplot
From: darby.vi...@gmail.com (Darby)
Injection-Date: Tue, 14 Apr 2020 20:43:56 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
View all headers
I've run into a problem with controlling the legend when using multiplot.  I want the legend to stay in 1 column on the right side of the plot.  With just a single plot per page, this works.  But if I use multiplot (4 plots per page, layout 2,2), the legend wants to split into multiple columns, even if I try to force it to one column with "maxcols 1".  In this case, the legend is too wide and obscures some of the plots.  However, a multiple with two tall plots side by side seems to do the right thing.  So it seems like this is tied to the size of the plot, not the page.  I've recreated this with some simple examples below.  I'm using gnuplot 4.6 patchlevel 2 on CentOS 7.7. 






set xrange [-pi:pi]
set key at screen 1,1

# ----------

# The legend for a single plot seems to respect the space of the plot
# and only uses 1 column.

set size 0.9,1.0
plot for [i=1:5] 10*sin(i*x) w l t 'sin',\
     for [i=1:5] 10*cos(i*x) w l t 'cos',\
     for [i=1:5]     i*x     w l t 'line',\
     for [i=1:5]    -i*x     w l t 'line'
pause -1

# ----------

# The legend for a multiplot seems NOT to respect the space of the plots
# and uses 2 columns, despite the explicit request for one column.

set key maxcols 1
set multiplot layout 2,2 scale 0.8, 1.0

   replot
   replot
   replot
   replot

unset multiplot

pause -1

# ----------

# But a "layout 1,2" multiplot will do one column.  Is it based on the height of the
# plot? 

set multiplot layout 1,2 scale 0.8, 1.0

   replot
   replot

unset multiplot

pause -1
# ----------


Subject: Re: Legend behavior with multiplot
From: Darby
Newsgroups: comp.graphics.apps.gnuplot
Date: Tue, 14 Apr 2020 20:47 UTC
References: 1
X-Received: by 2002:a05:620a:127c:: with SMTP id b28mr23286062qkl.317.1586897252676; Tue, 14 Apr 2020 13:47:32 -0700 (PDT)
X-Received: by 2002:a9d:6354:: with SMTP id y20mr10265545otk.171.1586897252413; Tue, 14 Apr 2020 13:47:32 -0700 (PDT)
Path: i2pn2.org!i2pn.org!aioe.org!feeder5.feed.usenet.farm!feed.usenet.farm!feeder.usenetexpress.com!tr1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.graphics.apps.gnuplot
Date: Tue, 14 Apr 2020 13:47:32 -0700 (PDT)
In-Reply-To: <3095ba79-70e8-4f1d-9c1f-c2f2b7561b3f@googlegroups.com>
Complaints-To: groups-abuse@google.com
Injection-Info: google-groups.googlegroups.com; posting-host=156.68.247.42; posting-account=KFhoNQoAAADZ5hYjCa2RcH8TjbhfoFQl
NNTP-Posting-Host: 156.68.247.42
References: <3095ba79-70e8-4f1d-9c1f-c2f2b7561b3f@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <1ebc26ce-fd32-4978-9f76-0ff2602f71f2@googlegroups.com>
Subject: Re: Legend behavior with multiplot
From: darby.vi...@gmail.com (Darby)
Injection-Date: Tue, 14 Apr 2020 20:47:32 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 0
View all headers
Arg, subject was supposed to be "Legend behavior with multiplot"...


Subject: Re: Legend behavior would multiplot
From: Jörg_Buchholz
Newsgroups: comp.graphics.apps.gnuplot
Organization: A noiseless patient Spider
Date: Thu, 16 Apr 2020 11:22 UTC
References: 1
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: bookwood...@freenet.de (Jörg_Buchholz)
Newsgroups: comp.graphics.apps.gnuplot
Subject: Re: Legend behavior would multiplot
Date: Thu, 16 Apr 2020 13:22:56 +0200
Organization: A noiseless patient Spider
Lines: 58
Message-ID: <r79f6g$7s6$1@dont-email.me>
References: <3095ba79-70e8-4f1d-9c1f-c2f2b7561b3f@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 16 Apr 2020 11:22:56 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="953fee75e28d39d85a0aef9979b661c6";
logging-data="8070"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19ALetDjWQsPHw8yB31gFcZzGFWTFnEf6I="
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:68.0) Gecko/20100101
Thunderbird/68.7.0
Cancel-Lock: sha1:E5K6khO0MWnCTynCam/HSg2ik2I=
In-Reply-To: <3095ba79-70e8-4f1d-9c1f-c2f2b7561b3f@googlegroups.com>
Content-Language: en-GB
View all headers
On 14.04.2020 22:43, Darby wrote:
I've run into a problem with controlling the legend when using
multiplot.  I want the legend to stay in 1 column on the right side
of the plot.  With just a single plot per page, this works.  But if I
use multiplot (4 plots per page, layout 2,2), the legend wants to
split into multiple columns, even if I try to force it to one column
with "maxcols 1".  In this case, the legend is too wide and obscures
some of the plots.  However, a multiple with two tall plots side by
side seems to do the right thing.  So it seems like this is tied to
the size of the plot, not the page.  I've recreated this with some
simple examples below.  I'm using gnuplot 4.6 patchlevel 2 on CentOS
7.7.


In your example you generate a legend for every plot at the same place.
A legend can't be longer or higher than the plot itself.

You can specify the place of every key entry separately in the plot
command. Than you can place the key entry where ever you want.

I don't know if this works with gnuplot 4.6, I tested it with gnuplot 5.2



set xrange [-pi:pi]
set key at screen 1,1
set key maxcols 1
set multiplot layout 2,3 columnsfirst scale 1.0, 1.0
plot 10*sin(1*x) w l t 'sin' at 0.9,0.9,\
     10*sin(2*x) w l t 'sin' at 0.9,0.86,\
     10*sin(1*x) w l t 'sin' at 0.9,0.82,\
     10*sin(2*x) w l t 'sin' at 0.9,0.78,\
     10*sin(2*x) w l t 'sin' at 0.9,0.74,\
     10*cos(1*x) w l t 'cos' at 0.9,0.70,\
     10*cos(2*x) w l t 'cos' at 0.9,0.66,\
     10*cos(1*x) w l t 'cos' at 0.9,0.62,\
     10*cos(2*x) w l t 'cos' at 0.9,0.58,\
     10*cos(2*x) w l t 'cos' at 0.9,0.54,\
     1*x w l t 'line' at 0.9,0.50,\
     2*x w l t 'line' at 0.9,0.46,\
     3*x w l t 'line' at 0.9,0.42,\
     4*x w l t 'line' at 0.9,0.38,\
     5*x w l t 'line' at 0.9,0.34,\
     -1*x w l t 'line' at 0.9,0.30,\
     -2*x w l t 'line' at 0.9,0.26,\
     -3*x w l t 'line' at 0.9,0.22,\
     -4*x w l t 'line' at 0.9,0.18,\
     -5*x w l t 'line' at 0.9,0.14
unset key
replot
replot
replot
unset multiplot


Jörg




Subject: Re: Legend behavior would multiplot
From: Jörg_Buchholz
Newsgroups: comp.graphics.apps.gnuplot
Organization: A noiseless patient Spider
Date: Mon, 20 Apr 2020 12:31 UTC
References: 1
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: bookwood...@freenet.de (Jörg_Buchholz)
Newsgroups: comp.graphics.apps.gnuplot
Subject: Re: Legend behavior would multiplot
Date: Mon, 20 Apr 2020 14:31:06 +0200
Organization: A noiseless patient Spider
Lines: 57
Message-ID: <r7k4mb$p45$1@dont-email.me>
References: <3095ba79-70e8-4f1d-9c1f-c2f2b7561b3f@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 20 Apr 2020 12:31:07 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="9d121b6f21386b7a1230b8047b542f81";
logging-data="25733"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+Q3ThzTBQ4Ppwzs46W/7VfJrdkRCUCHWU="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101
Thunderbird/68.7.0
Cancel-Lock: sha1:ysA/xCZ23O27UjJ+heQZegOyVpM=
In-Reply-To: <3095ba79-70e8-4f1d-9c1f-c2f2b7561b3f@googlegroups.com>
Content-Language: en-GB
View all headers
On 14.04.20 22:43, Darby wrote:
I've run into a problem with controlling the legend when using
multiplot.  I want the legend to stay in 1 column on the right side
of the plot.  With just a single plot per page, this works.  But if I
use multiplot (4 plots per page, layout 2,2), the legend wants to
split into multiple columns, even if I try to force it to one column
with "maxcols 1".  In this case, the legend is too wide and obscures
some of the plots.  However, a multiple with two tall plots side by
side seems to do the right thing.  So it seems like this is tied to
the size of the plot, not the page.  I've recreated this with some
simple examples below.  I'm using gnuplot 4.6 patchlevel 2 on CentOS
7.7.

You can do a "dummyplot" only for the key. This works with older versions than 5.2

reset
unset key
set xrange [-pi:pi]
set multiplot
set size 0.4,0.5
set origin 0.0,0.0
plot for [i=1:5] 10*sin(i*x) w l t 'sin',\
      for [i=1:5] 10*cos(i*x) w l t 'cos',\
      for [i=1:5]     i*x     w l t 'line',\
      for [i=1:5]    -i*x     w l t 'line'

set size 0.4,0.5
set origin 0.0,0.5
replot

set size 0.4,0.5
set origin 0.4,0.0
replot

set size 0.4,0.5
set origin 0.4,0.5
replot

#---dummyplot--------
set key left
set size 0.2,1.0
set origin 0.8,0.0
unset grid
unset tics
unset border
set xrange [0:1]
set yrange [0:1]
plot for [i=1:5] (10*sin(i*x))-10 w l t 'sin',\
      for [i=1:5] (10*cos(i*x))-10 w l t 'cos',\
      for [i=1:5]     (i*x)-10     w l t 'line',\
      for [i=1:5]    (-i*x)-10     w l t 'line'

unset multiplot


Jörg


1

rocksolid light 0.8.3
clearneti2ptor