Path: csiph.com!news.swapon.de!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Ethan A Merritt Newsgroups: comp.graphics.apps.gnuplot Subject: Re: plot with offset in labels Date: Fri, 01 Apr 2016 18:08:52 -0700 Organization: A noiseless patient Spider Lines: 44 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit Injection-Date: Sat, 2 Apr 2016 01:05:40 -0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="7bbfccb08e3cb0f92ebf95516f5f5a81"; logging-data="28361"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19Cm88LaHRAyWyXKSh9mzCB" User-Agent: KNode/4.14.5 Cancel-Lock: sha1:Shq8Ez+QqlvRGdvdY7xDR5ZMGiw= Xref: csiph.com comp.graphics.apps.gnuplot:3282 Karl Ratzsch wrote: > Can anybody tell me what is wrong with this plot (tested in gp5.0.3)? > > ==== > $data << EOD > 402 32 6 > 404 107 22 > 406 139 51 > > > 402 34 6 > 404 64 22 > 406 84 51 > EOD > > unset key > > plot $data index 1 us 3:2 w p,\ > $data index 0 us 3:2 w p > > replot $data index 1 us 3:2:("left") with labels offset 2,0 > replot $data index 0 us 3:2:("up") with labels offset 0,1 > ==== > > If I comment out any of the two later plots, no error occurs. > Without any offset, there is also no problem. The problem is that "offset" in the general case takes up to 3 following values: x, y, and z. It stops if it doesn't encounter a comma before the next value. So this syntax confuses it: plot $foo ... offset x,y, $baz because it tries to interpret $baz as a z offset value rather than a new plot. This was a problem for a long time, but it has been fixed in the cvs version by teaching the relevant get_position_xxx() routines that in a 2D context they should only expect 2 values. That was largish set of patches that do not apply cleanly to version 5.0 so backporting is not automatic. Ethan