Path: csiph.com!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: =?UTF-8?Q?J=c3=b6rg_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: 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 Xref: csiph.com comp.graphics.apps.gnuplot:4323 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