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


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

Legend behavior would multiplot

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 csiph.com!xmission!news.snarked.org!border2.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: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> (permalink)
Subject Legend behavior would multiplot
From Darby <darby.vicker@gmail.com>
Injection-Date Tue, 14 Apr 2020 20:43:56 +0000
Content-Type text/plain; charset="UTF-8"
Content-Transfer-Encoding quoted-printable
Lines 62
Xref csiph.com comp.graphics.apps.gnuplot:4321

Show key headers only | View raw


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
# ----------

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


Thread

Legend behavior would multiplot Darby <darby.vicker@gmail.com> - 2020-04-14 13:43 -0700
  Re: Legend behavior with multiplot Darby <darby.vicker@gmail.com> - 2020-04-14 13:47 -0700
  Re: Legend behavior would multiplot Jörg Buchholz <bookwood4new@freenet.de> - 2020-04-16 13:22 +0200
  Re: Legend behavior would multiplot Jörg Buchholz <bookwood4new@freenet.de> - 2020-04-20 14:31 +0200

csiph-web