Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.graphics.apps.gnuplot > #3281 > unrolled thread
| Started by | Karl Ratzsch <mail.kfr@gmx.net> |
|---|---|
| First post | 2016-04-01 21:54 +0200 |
| Last post | 2016-04-03 19:36 +0200 |
| Articles | 3 — 2 participants |
Back to article view | Back to comp.graphics.apps.gnuplot
plot with offset in labels Karl Ratzsch <mail.kfr@gmx.net> - 2016-04-01 21:54 +0200
Re: plot with offset in labels Ethan A Merritt <EAMerritt@gmail.com> - 2016-04-01 18:08 -0700
Re: plot with offset in labels Karl Ratzsch <mail.kfr@gmx.net> - 2016-04-03 19:36 +0200
| From | Karl Ratzsch <mail.kfr@gmx.net> |
|---|---|
| Date | 2016-04-01 21:54 +0200 |
| Subject | plot with offset in labels |
| Message-ID | <ndmjlo$7d4$1@solani.org> |
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.
Karl
[toc] | [next] | [standalone]
| From | Ethan A Merritt <EAMerritt@gmail.com> |
|---|---|
| Date | 2016-04-01 18:08 -0700 |
| Message-ID | <ndn5t4$rm9$1@dont-email.me> |
| In reply to | #3281 |
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
[toc] | [prev] | [next] | [standalone]
| From | Karl Ratzsch <mail.kfr@gmx.net> |
|---|---|
| Date | 2016-04-03 19:36 +0200 |
| Message-ID | <ndrkb2$gmd$1@solani.org> |
| In reply to | #3282 |
Am 02.04.2016 um 03:08 schrieb Ethan A Merritt: > > 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. So the workaround is to give a third (dummy) offset? Trying ... works. Thank you! Karl
[toc] | [prev] | [standalone]
Back to top | Article view | comp.graphics.apps.gnuplot
csiph-web