Re: [NTG-context] gnuplot module broken with latest 2020-07-13 16:31

2020-07-13 Thread Adam Reviczky
Many thanks for the quick fix Hans,

I have tried the lmtx inclusions as well, very nice indeed (and added it to
the wiki)!

Kind Regards,
Adam Reviczky

On Mon, Jul 13, 2020 at 10:38 PM Hans Hagen  wrote:

> On 7/13/2020 8:53 PM, Adam Reviczky wrote:
> > Hi,
> >
> > Using the minimal example from the contextgarden for gnuplot
> > (https://wiki.contextgarden.net/Gnuplot) I am getting the following
> > error message:
> >
> > This is LuaTeX, Version 1.13.0 (TeX Live 2021/dev/Debian)
> >   system commands enabled.
> > open source > level 1, order 1, name
> > '/usr/share/texmf/tex/context/base/mkiv/cont-yes.mkiv'
> > system  >
> > system  > ConTeXt  ver: 2020.07.13 16:23 MKIV  fmt: 2020.7.13
> >   int: english/english
> > system  >
> > system  > 'cont-new.mkiv' loaded
> > open source > level 2, order 2, name
> > '/usr/share/texmf/tex/context/base/mkiv/cont-new.mkiv'
> > system  > beware: some patches loaded from cont-new.mkiv
> > close source> level 2, order 2, name
> > '/usr/share/texmf/tex/context/base/mkiv/cont-new.mkiv'
> > system  > files > jobname 'mwe', input './mwe', result 'mwe'
> > fonts   > latin modern fonts are not preloaded
> > languages   > language 'en' is active
> > open source > level 2, order 3, name '/tmp/4/mwe.tex'
> > modules > 'gnuplot' is loaded
> > open source > level 3, order 4, name
> > '/usr/share/texmf/tex/context/third/gnuplot/t-gnuplot.mkiv'
> > loading > Gnuplot module
> > open source > level 4, order 5, name
> > '/usr/share/texmf/tex/context/fonts/mkiv/type-imp-texgyre.mkiv'
> > close source> level 4, order 5, name
> > '/usr/share/texmf/tex/context/fonts/mkiv/type-imp-texgyre.mkiv'
> > close source> level 3, order 5, name
> > '/usr/share/texmf/tex/context/third/gnuplot/t-gnuplot.mkiv'
> >
> > lua error   > lua error on line 4 in file /tmp/4/mwe.tex:
> >
> > /usr/share/texmf/tex/context/base/mkiv/buff-ini.lua:439: attempt to call
> > a nil value (upvalue 'gettoken')
> > stack traceback:
> > /usr/share/texmf/tex/context/base/mkiv/buff-ini.lua:439: in upvalue
> 'pickup'
> > /usr/share/texmf/tex/context/base/mkiv/buff-ini.lua:635: in function
> > 
> > (...tail calls...)
> >
> >   1 \usemodule[gnuplot]
> >   2
> >   3 % write a script for gnuplot
> >   4 >>  \startGNUPLOTscript[sin]
> >   5plot sin(x)
> >   6 \stopGNUPLOTscript
> >   7
> >   8 % include the resulting graphic into the document
> >   9 \useGNUPLOTgraphic[sin]
> > 10
> >
> > mtx-context | fatal error: return code: 256
> >
> > Does the gnuplot module need adjustments?
> No, i messed up something ... will be fixed tomorrow
>
> Do you have lmtx installed? It has nicer gnuplot support:
>
> m-gnuplot-demo.gp :
>
> 
> set format xy "$%g$"
>
> set title  'This is a plot of $y=\\sin(x)$'
> set xlabel 'This is the $x$ axis'
> set ylabel 'This is the $y$ axis'
>
> plot [0:6.28] [0:1] sin(x)
> 
>
> Can be included with:
>
> \starttext
>
>  \externalfigure[m-gnuplot-demo.gp][conversion=svg,width=4cm]
>
>  \externalfigure[m-gnuplot-demo.gp][conversion=svg,width=8cm]
>
> \stoptext
>
>
> -
>Hans Hagen | PRAGMA ADE
>Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
> tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -
>
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] gnuplot module broken with latest 2020-07-13 16:31

2020-07-13 Thread Hans Hagen

On 7/13/2020 8:53 PM, Adam Reviczky wrote:

Hi,

Using the minimal example from the contextgarden for gnuplot 
(https://wiki.contextgarden.net/Gnuplot) I am getting the following 
error message:


This is LuaTeX, Version 1.13.0 (TeX Live 2021/dev/Debian)
  system commands enabled.
open source     > level 1, order 1, name 
'/usr/share/texmf/tex/context/base/mkiv/cont-yes.mkiv'

system          >
system          > ConTeXt  ver: 2020.07.13 16:23 MKIV  fmt: 2020.7.13 
  int: english/english

system          >
system          > 'cont-new.mkiv' loaded
open source     > level 2, order 2, name 
'/usr/share/texmf/tex/context/base/mkiv/cont-new.mkiv'

system          > beware: some patches loaded from cont-new.mkiv
close source    > level 2, order 2, name 
'/usr/share/texmf/tex/context/base/mkiv/cont-new.mkiv'

system          > files > jobname 'mwe', input './mwe', result 'mwe'
fonts           > latin modern fonts are not preloaded
languages       > language 'en' is active
open source     > level 2, order 3, name '/tmp/4/mwe.tex'
modules         > 'gnuplot' is loaded
open source     > level 3, order 4, name 
'/usr/share/texmf/tex/context/third/gnuplot/t-gnuplot.mkiv'

loading         > Gnuplot module
open source     > level 4, order 5, name 
'/usr/share/texmf/tex/context/fonts/mkiv/type-imp-texgyre.mkiv'
close source    > level 4, order 5, name 
'/usr/share/texmf/tex/context/fonts/mkiv/type-imp-texgyre.mkiv'
close source    > level 3, order 5, name 
'/usr/share/texmf/tex/context/third/gnuplot/t-gnuplot.mkiv'


lua error       > lua error on line 4 in file /tmp/4/mwe.tex:

/usr/share/texmf/tex/context/base/mkiv/buff-ini.lua:439: attempt to call 
a nil value (upvalue 'gettoken')

stack traceback:
/usr/share/texmf/tex/context/base/mkiv/buff-ini.lua:439: in upvalue 'pickup'
/usr/share/texmf/tex/context/base/mkiv/buff-ini.lua:635: in function 


(...tail calls...)

  1     \usemodule[gnuplot]
  2
  3     % write a script for gnuplot
  4 >>  \startGNUPLOTscript[sin]
  5        plot sin(x)
  6     \stopGNUPLOTscript
  7
  8     % include the resulting graphic into the document
  9     \useGNUPLOTgraphic[sin]
10

mtx-context     | fatal error: return code: 256

Does the gnuplot module need adjustments?

No, i messed up something ... will be fixed tomorrow

Do you have lmtx installed? It has nicer gnuplot support:

m-gnuplot-demo.gp :


set format xy "$%g$"

set title  'This is a plot of $y=\\sin(x)$'
set xlabel 'This is the $x$ axis'
set ylabel 'This is the $y$ axis'

plot [0:6.28] [0:1] sin(x)


Can be included with:

\starttext

\externalfigure[m-gnuplot-demo.gp][conversion=svg,width=4cm]

\externalfigure[m-gnuplot-demo.gp][conversion=svg,width=8cm]

\stoptext


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] gnuplot-module broken under lmtx

2019-04-10 Thread Hans Hagen

On 4/10/2019 4:34 PM, Christian Prim wrote:

Hi

It's little off-topic as there are officially no modules included in 
lmtx. But when I used the modules from a mkiv-installation, there was 
little to no problem. But with the gnuplot-module I can't fix the error 
myself.


not off-topic .. as modules should also work ok in lmtx

fixed in next beta (probably tommorrow an upload)

Hans


MWE:
\usemodule[gnuplot]
\startGNUPLOTscript[sin]
    plot sin(x)
\stopGNUPLOTscript

\starttext
\placefigure[here]{Sine Test}{\useGNUPLOTgraphic[sin]}
\stoptext

Under mkiv everything is fine. mkiv creates a 
file gnuplot-gnuplot-1.plt, sends this file to gnuplot and uses the 
output gnuplot-gnuplot-1-ctx.tex.


Under lmtx only the files gnuplot-gnuplot-1.tmp 
and gnuplot-gnuplot-inclusions.tmp are created. When I copy the correct 
.plt file from a mkiv-run, no gnuplot-gnuplot-1-ctx.tex is generated. If 
I copy the correct -ctx.tex file from a mkiv-run, I still get an error.


Relevant part from the logfile of a working mkiv-run:
modules         > 'gnuplot' is loaded
open source     > level 3, order 4, name 
'/home/user/context/tex/texmf-modules/tex/context/third/gnuplot/t-gnuplot.mkiv'

loading         > Gnuplot module
open source     > level 4, order 5, name 
'/home/user/context/tex/texmf-context/tex/context/fonts/mkiv/type-imp-texgyre.mkiv'
close source    > level 4, order 5, name 
'/home/user/context/tex/texmf-context/tex/context/fonts/mkiv/type-imp-texgyre.mkiv'
close source    > level 3, order 5, name 
'/home/user/context/tex/texmf-modules/tex/context/third/gnuplot/t-gnuplot.mkiv'

fonts           > preloading latin modern fonts (second stage)
fonts           > 'fallback modern-designsize rm 12pt' is loaded
open source     > level 3, order 6, name 'gnuplot-gnuplot-1-ctx.tex'
close source    > level 3, order 6, name 'gnuplot-gnuplot-1-ctx.tex'
metapost        > initializing instance 'metafun:1' using format 
'metafun' and method 'default'
metapost        > loading 'metafun' as 
'/home/user/context/tex/texmf-context/metapost/context/base/mpiv/metafun.mpiv' 
using method 'default'

metapost        > initializing number mode 'scaled'
floatblocks     > '1' placed (here)

from a lmtx-run (no .plt-file and -ctx.tex given):

modules         > 'gnuplot' is loaded
open source     > level 3, order 4, name 
'/home/user/lmtx/tex/texmf-modules/tex/context/third/gnuplot/t-gnuplot.mkiv'

loading         > Gnuplot module
open source     > level 4, order 5, name 
'/home/user/lmtx/tex/texmf-context/tex/context/fonts/mkiv/type-imp-texgyre.mkiv'
close source    > level 4, order 5, name 
'/home/user/lmtx/tex/texmf-context/tex/context/fonts/mkiv/type-imp-texgyre.mkiv'
close source    > level 3, order 5, name 
'/home/user/lmtx/tex/texmf-modules/tex/context/third/gnuplot/t-gnuplot.mkiv'

fonts           > preloading latin modern fonts (second stage)
fonts           > 'fallback modern-designsize rm 12pt' is loaded
mtxrun          |
mtxrun          | executing: gnuplot gnuplot-gnuplot-1.plt
mtxrun          |
mtxrun          |
/home/user/lmtx/tex/texmf-linux-64/bin/mtxrun.lua:26166: attempt to call 
a nil value (field 'exec')

aaa             > mtxrun --direct gnuplot gnuplot-gnuplot-1.plt
floatblocks     > no block given
floatblocks     > '1' placed (here)

lmtx with given .plt and -ctx.tex-file:

modules         > 'gnuplot' is loaded
open source     > level 3, order 4, name 
'/home/user/lmtx/tex/texmf-modules/tex/context/third/gnuplot/t-gnuplot.mkiv'

loading         > Gnuplot module
open source     > level 4, order 5, name 
'/home/user/lmtx/tex/texmf-context/tex/context/fonts/mkiv/type-imp-texgyre.mkiv'
close source    > level 4, order 5, name 
'/home/user/lmtx/tex/texmf-context/tex/context/fonts/mkiv/type-imp-texgyre.mkiv'
close source    > level 3, order 5, name 
'/home/user/lmtx/tex/texmf-modules/tex/context/third/gnuplot/t-gnuplot.mkiv'

fonts           > preloading latin modern fonts (second stage)
fonts           > 'fallback modern-designsize rm 12pt' is loaded
mtxrun          |
mtxrun          | executing: gnuplot gnuplot-gnuplot-1.plt
mtxrun          |
mtxrun          |
/home/user/lmtx/tex/texmf-linux-64/bin/mtxrun.lua:26166: attempt to call 
a nil value (field 'exec')

aaa             > mtxrun --direct gnuplot gnuplot-gnuplot-1.plt
open source     > level 3, order 6, name 'gnuplot-gnuplot-1-ctx.tex'
close source    > level 3, order 6, name 'gnuplot-gnuplot-1-ctx.tex'
metapost        > initializing instance 'metafun:1' using format 
'metafun' and method 'default'
metapost        > loading 'metafun' as 
'/home/user/lmtx/tex/texmf-context/metapost/context/base/mpiv/metafun.mpiv' 
using method 'default'

metapost        > initializing number mode 'scaled'
floatblocks     > '1' placed (here)

tex error       > tex error on line 1 in file gnuplot-gnuplot-1-ctx.tex: 
! Undefined control sequence


 \GNUPLOTfile
              -ctx.tex
\fourthoffivearguments #1#2#3#4#5->#4

 set output "\@@GNUPLOTresult
                              "


Re: [NTG-context] gnuplot module broken

2013-04-19 Thread Mojca Miklavec
Dear Hans,

please consider the following example in MKII:

\setupcolors[state=start]

\starttext

\startMPextensions
a := \abc;
color b;
b := \MPcolor{currentcolor};
\stopMPextensions

\startuseMPgraphic{bla}
fill fullcircle scaled a withcolor b;
\stopuseMPgraphic

\def\abc{3cm}\color[blue]{\useMPgraphic{bla}}

% Nice small black circle
\def\abc{1cm}\useMPgraphic{bla}

\stoptext


I still don't know how to reproduce this in MKIV. I tried with
MPdefinitions as you suggested, but this only works the first time
when it is used. The following example creates two equal circles
instead of two different ones:


\starttext

\startMPdefinitions
a := \abc;
color b;
b := \MPcolor{currentcolor};
\stopMPdefinitions

\startuseMPgraphic{bla}
fill fullcircle scaled a withcolor b;
\stopuseMPgraphic

\def\abc{3cm}\color[blue]{\useMPgraphic{bla}}

% I want a black 1cm circle here
\def\abc{1cm}\useMPgraphic{bla}

\stoptext


Unless MKII is more powerful than MKIV: how can I achieve the same
functionality in MKIV as I did in MKII?

Thank you,
Mojca


On Tue, Feb 19, 2013 at 10:36 AM, Hans Hagen wrote:
 On 2/19/2013 1:37 AM, Mojca Miklavec wrote:

 On Mon, Feb 18, 2013 at 5:40 PM, Marco Patzer wrote:

 Hi Mojca et al.

 todays beta broke the gnuplot module. This is probably due to the
 changes in the MP inclusion mechanism.

 \usemodule [gnuplot]
 \starttext
 \stoptext

 Here's an almost minimal example:

 \def\abc{1cm}

 \startMPextensions
 a := \abc;
 color b;
 b := \MPcolor{currentcolor};
 \stopMPextensions

 \def\abc{3cm}

 \starttext
 \startcolor[blue]
 \startMPcode
 fill fullcircle scaled a withcolor b;
 \stopMPcode
 \stopcolor
 \stoptext

 The old ConTeXt draws a blue circle with diameter 3cm and the new
 ConTeXt draws a black circle with diameter 1cm. Which one is right?
  From a recent message by Hans:

 - add mp functionality (immediate expansion)


 It seems that ConTeXt now parses everything inside MPextensions
 earlier than it did before and I don't have the slightest idea how to
 account for this in the module without a major rewrite. In case that
 Hans wants to keep the new functionality, I either need [quite some]
 help with the module or I'll simply stick to TeX Live 2012 for the
 foreseeable future ;)


 For the (not texlive) module use:

 \defineMPinstance[gnuplot]
   [format=metafun,
extensions=yes,
initializations=yes,
method=double]

 \startMPdefinitions[gnuplot] ...

 and then use the gnuplot instance. This not only isolates the code, but also
 gives you floats. It also means that if someone crashes the gnuplot
 instance, the rest still keeps running.

 Definitions are per instance and are delayed i.e. passed via the tex end
 when they get expanded.

 The reason for extensions being immediate (at least for now) is that it was
 more easy to implement as extensions meant for mp extensions and can be for
 all instances of specific (sets) of instances.

 Sorry for the changes but as we have multiple instances, scale vs double and
 maybe more coming it's probably worth the trouble.

 Hans
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] gnuplot module broken

2013-04-19 Thread Marco Patzer
On 2013–04–19 Mojca Miklavec wrote:

 Dear Hans,
 
 please consider the following example in MKII:
 
 \setupcolors[state=start]
 
 \starttext
 
 \startMPextensions
 a := \abc;
 color b;
 b := \MPcolor{currentcolor};
 \stopMPextensions
 
 \startuseMPgraphic{bla}
 fill fullcircle scaled a withcolor b;
 \stopuseMPgraphic
 
 \def\abc{3cm}\color[blue]{\useMPgraphic{bla}}
 
 % Nice small black circle
 \def\abc{1cm}\useMPgraphic{bla}
 
 \stoptext
 
 
 I still don't know how to reproduce this in MKIV.

Use \startMPinitializations instead of \startMPextensions, it's
global to all MP instances, though.

Marco


signature.asc
Description: Digital signature
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] gnuplot module broken

2013-02-19 Thread Hans Hagen

On 2/19/2013 1:37 AM, Mojca Miklavec wrote:

On Mon, Feb 18, 2013 at 5:40 PM, Marco Patzer wrote:

Hi Mojca et al.

todays beta broke the gnuplot module. This is probably due to the
changes in the MP inclusion mechanism.

\usemodule [gnuplot]
\starttext
\stoptext


Here's an almost minimal example:

\def\abc{1cm}

\startMPextensions
a := \abc;
color b;
b := \MPcolor{currentcolor};
\stopMPextensions

\def\abc{3cm}

\starttext
\startcolor[blue]
\startMPcode
fill fullcircle scaled a withcolor b;
\stopMPcode
\stopcolor
\stoptext

The old ConTeXt draws a blue circle with diameter 3cm and the new
ConTeXt draws a black circle with diameter 1cm. Which one is right?
 From a recent message by Hans:


- add mp functionality (immediate expansion)


It seems that ConTeXt now parses everything inside MPextensions
earlier than it did before and I don't have the slightest idea how to
account for this in the module without a major rewrite. In case that
Hans wants to keep the new functionality, I either need [quite some]
help with the module or I'll simply stick to TeX Live 2012 for the
foreseeable future ;)


For the (not texlive) module use:

\defineMPinstance[gnuplot]
  [format=metafun,
   extensions=yes,
   initializations=yes,
   method=double]

\startMPdefinitions[gnuplot] ...

and then use the gnuplot instance. This not only isolates the code, but 
also gives you floats. It also means that if someone crashes the gnuplot 
instance, the rest still keeps running.


Definitions are per instance and are delayed i.e. passed via the tex end 
when they get expanded.


The reason for extensions being immediate (at least for now) is that it 
was more easy to implement as extensions meant for mp extensions and can 
be for all instances of specific (sets) of instances.


Sorry for the changes but as we have multiple instances, scale vs double 
and maybe more coming it's probably worth the trouble.


Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] gnuplot module broken

2013-02-18 Thread Mojca Miklavec
On Mon, Feb 18, 2013 at 5:40 PM, Marco Patzer wrote:
 Hi Mojca et al.

 todays beta broke the gnuplot module. This is probably due to the
 changes in the MP inclusion mechanism.

 \usemodule [gnuplot]
 \starttext
 \stoptext

Here's an almost minimal example:

\def\abc{1cm}

\startMPextensions
a := \abc;
color b;
b := \MPcolor{currentcolor};
\stopMPextensions

\def\abc{3cm}

\starttext
\startcolor[blue]
\startMPcode
fill fullcircle scaled a withcolor b;
\stopMPcode
\stopcolor
\stoptext

The old ConTeXt draws a blue circle with diameter 3cm and the new
ConTeXt draws a black circle with diameter 1cm. Which one is right?
From a recent message by Hans:

 - add mp functionality (immediate expansion)

It seems that ConTeXt now parses everything inside MPextensions
earlier than it did before and I don't have the slightest idea how to
account for this in the module without a major rewrite. In case that
Hans wants to keep the new functionality, I either need [quite some]
help with the module or I'll simply stick to TeX Live 2012 for the
foreseeable future ;)

Mojca
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] gnuplot module does not work

2012-01-13 Thread Mojca Miklavec
On Fri, Jan 13, 2012 at 14:35, zs wrote:
 Hello,

 it seem like gnuplot module does not work with recent ConTeXt Standalone.

Thank you very much for the report.

 --- error message 

 ! Undefined control sequence.

 system           tex  error on line 110 in file pokus_min.tex: Undefined 
 control sequence ...


 l.110 \runMPgraphicstrue

This one seems easy to fix - just comment out \runMPgraphicstrue in
t-gnuplot.tex. But I have other problems with buffers after trying
that. (See the topic buffer broken? from two days ago.)

I'm using 2012.01.12 15:48 and it bails out in the same way:

! Extra }, or forgotten \endgroup.

system   tex  error on line 14 in file gptest.tex: Extra },
or forgotten  ...

 4
 5  \startGNUPLOTscript[aaa]
 6  plot [0:5] -
 7  0   1
 8  1   2
 9  2   5
10  3   10
11  4   17
12  5   26
13  e
14\stopGNUPLOTscript
15
16  \useGNUPLOTgraphic[aaa]
17
18  \stoptext
19


\stopGNUPLOTscript -\egroup
 \ifx \savebuffer \undefined \else \savebuffer [...
\buff_finish ...oup \buff_stop {stopGNUPLOTscript}
  \endgroup
l.14  \stopGNUPLOTscript

?

Mojca


 --- example -

 \usemodule[gnuplot]

 \starttext

 \startGNUPLOTscript[aaa]
 plot [0:5] -
 0       1
 1       2
 2       5
 3       10
 4       17
 5       26
 e
 \stopGNUPLOTscript

 \useGNUPLOTgraphic[aaa]

 \stoptext
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] gnuplot module does not work

2012-01-13 Thread Hans Hagen

On 13-1-2012 17:10, Mojca Miklavec wrote:


This one seems easy to fix - just comment out \runMPgraphicstrue in
t-gnuplot.tex. But I have other problems with buffers after trying
that. (See the topic buffer broken? from two days ago.)

I'm using 2012.01.12 15:48 and it bails out in the same way:

! Extra }, or forgotten \endgroup.


buffers are fixed in the next beta (not yet uploaded)


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] gnuplot module: `option=monochrome` does not work.

2011-12-13 Thread Mojca Miklavec
On Tue, Dec 13, 2011 at 18:03, Paul Menzel wrote:
 Dear ConTeXt folks,


 I want to create monochrome plots, but `option=monochrome` is ignored.

(Ashamed.) Yes, you are right.

        \usemodule[gnuplot]

        \setupGNUPLOT[terminal=context,option=monochrome]

This passes the option to terminal if no better way is available. This
would only help you in case of png, pdf or metapost terminal. For
ConTeXt terminal in input mode it wouldn't help you since the option
color/dashed/etc. are completely ignored. This means that gnuplot will
only consider options fontscale=, points=metapost|tex, width= and
height= since that influences the output. Colors and dashed/solid
lines can be turned on and off on the fly, same for line widths (you
can redraw the same graph with dash turned on and off, using the same
gnuplot output).

First of all, I should fix documentation on that (using it that way is
slightly deprecated and should only be used if the option is not). But
second of all .. I just realized that, for example, standalone mode
writes out

\setupGNUPLOTterminal
   [context]
   [linejoin=mitered, % *mitered* | rounded | beveled
linecap=butt, % *butt* | rounded | squared
dashed=yes, % *yes* | no
dashlength=1, % scaling factor for dash lengths
linewidth=1, % scaling factor for line widths (1.0 means 0.5bp)
%fontscale=1, % scaling factor for text labels
points=metapost, % *metapost* | tex (Should points be drawn with
MetaPost or TeX?)
images=inline] % *inline* | external (inline only works in MKIV,
external requires png support in gnuplot)

but I completely forgot about monochrome option!!! Or rather ... I see
that I print out \setupcolors[state=start] if and only if color is
switched on, but that won't really help you in standalone mode. Ouch!
I'm sorry. You don't need to recompile the terminal for that, but I
need to fix t-gnuplot.tex and mp-gnuplot.mp. Does, according to what
you see above, color=yes|no make sense? (I will also have to change
the terminal for standalone mode, but that won't affect your plots.)

However, the main reason why I didn't do it better before is because I
have no idea what to do with monochrome. That is: should I use
different shades of gray? Should I simply make all the colors solid
black? And then the user should use color=no,dashed=yes? I'm
particularly confused about the choice between different shades of
gray and black.

And yes - I'll fix the wiki page.

Here's a quick workaround:

\startMPextensions
gp_color_lt[0] := black;
gp_color_lt[1] := black;
gp_color_lt[2] := black;
gp_color_lt[3] := black;
gp_color_lt[4] := black;
gp_color_lt[5] := black;
gp_color_lt[6] := black;
gp_color_lt[7] := black;
gp_color_lt[8] := black;
\stopMPextensions

Mojca
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] gnuplot module: `option=monochrome` does not work.

2011-12-13 Thread Mojca Miklavec
Dear Paul,

Just a few more thoughts:

- If your whole document is black-and-white (if you switch colors off
globally), the plot will turn out black-and-white anyway (actually it
will be different shades of gray).

- You can always use something like
plot pi lt 1 lc 0, 2*pi lt 2 lc 0
or
lc rgb black (if I'm not mistaken about the syntax)
or
set style line 1 lt 1 lc 0
set style line 2 lt 2 lc 0
plot sin(x) ls 1, cos(x) ls 2, ...

Mojca
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] gnuplot module

2011-12-11 Thread Paul Menzel
Am Montag, den 12.12.2011, 01:40 +0100 schrieb Mojca Miklavec:
 (was: gnuplot: `! Undefined control sequence.` with format specifier %)
 (sorry, but it was too long to keep it all in title :)
 
 On Mon, Dec 12, 2011 at 01:30, Paul Menzel wrote:
 
  Thank you for the follow up. I just blindly copied the example from the
  Wiki and did not pay any attention. In my thesis, I of course use the
  ConTeXt terminal.
 
 What is the thesis going to be about?

The topic is how long integrated random walks stay positiv. Not being
able to prove that formally for double-integrated(?) random walk, I am
doing some simulations.

 (I just noticed that mptopdf complains about missing bibtex files. :)

It seems to work for me.

  PS: Do you have a BibTeX entry for your gnuplot module?
 
 Do you suggest me to publish an article about the terminal in arXiv,
 to get at least some citations by the time when I need to submit my
 thesis? :P

That is an idea. ;-)

 But no, I don't have it. I could try to create one though, but I'm not
 even sure what the webpage should be. Many scientific programs just
 ask to cite their first article in some scientific journal if one uses
 the software, but I neither have an article nor homepage apart from
 that (still outdated) wiki page.
 
 There is some additional documentation on
 https://github.com/mojca/context-gnuplot/tree/master/texmf/doc/context/third/gnuplot
 (possibly also in minimals, but I'm not sure when I last synced the
 version), but even that is outdated now since they required from me to
 strip down terminal options parsing code.

I thought asking does not hurt. ;-) So I guess I will just reference
ConTeXt and gnuplot then.


Thanks,

Paul


signature.asc
Description: This is a digitally signed message part
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Gnuplot module: Patching of Gnuplot binary still needed?

2011-01-10 Thread jeroen . muskee
I have tried

texexec --make --all 

and changing line 484 from

\getfiguredimensions[\@@GNUPLOTresult]

into

\getfiguredimensions[\@@GNUPLOTfinalresult]

but neither is giving me any luck. Now also 

install-setup.bat --extras=t-gnuplot

is not working anymore. Not sure what the issue is.

Jeroen

--
This message was sent on behalf of jeroen.mus...@hotmail.com at 
openSubscriber.com
http://www.opensubscriber.com/message/ntg-context@ntg.nl/14992530.html
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Gnuplot module: Patching of Gnuplot binary still needed?

2011-01-09 Thread jeroen . muskee
In the past I was using this instruction set to install GnuPlot in Windows 
Context Mkiv minimals but it does not work anymore. Is there a bug in t-gnuplot 
version 2009-07-21?

Create folder c:\context\gnuplot
Download from http://dl.contextgarden.net/modules/gnuplot-win.zip the gnuplot 
file gnuplot-win.zip and unzip in folder c:\context so you have folders 
c:\context\gnuplot\bin and c:\context\gnuplot\term
Create a batch file c:\context\gnuplot\bin\gnuplot.bat with content 
c:\context\gnuplot\bin\wgnuplot.exe %*
STARTRUNCMD ENTER
SET PATH=%PATH%;c:\context\gnuplot\bin ENTER
Test GNUPLOT by entering gnuplot in the CLI console and give in gnuplot the 
command plot sin(x) ENTER
Create folder c:\context\tex\texmf\tex\context\third\gnuplot
Download 
http://theory.uwinnipeg.ca/scripts/CTAN/macros/context/contrib/context-gnuplot.zip
 or http://dl.contextgarden.net/modules/t-gnuplot-2009.07.21.zip module and 
unzip and put in folder c:\context\tex\texmf\tex\context\third\gnuplot and 
c:\context\text\texmf\metapost\base\ so you have 
c:\context\tex\texmf\tex\context\third\gnuplot\t-gnuplot.tex and 
c:\context\text\texmf\metapost\base\mp-gnuplot.mp
Startruncmdc: ENTER cd \context\tex\texmf-mswin\bin ENTER context – 
-generate ENTER
(For MkII users use the following command mktexlsr)
Enter the following data to test GNUPLOT

\usemodule[gnuplot]
\enableregime[utf]
\setupGNUPLOT[terminal=mp]

\startGNUPLOTscript[mysinplot]
set xlabel “time”
set ylabel “value”
plot sin(x)
\stopGNUPLOTscript

\starttext
text before picture
\useGNUPLOTgraphic[mysinplot]
text after picture
\stoptext


--
This message was sent on behalf of jeroen.mus...@hotmail.com at 
openSubscriber.com
http://www.opensubscriber.com/message/ntg-context@ntg.nl/14815843.html
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Gnuplot module: Patching of Gnuplot binary still needed?

2011-01-09 Thread Mojca Miklavec
On Sun, Jan 9, 2011 at 22:50,  jeroen.mus...@hotmail.com wrote:
 In the past I was using this instruction set to install GnuPlot in Windows 
 Context Mkiv minimals but it does not work anymore. Is there a bug in 
 t-gnuplot version 2009-07-21?

Thanks a lot for the bug report. I can confirm that it fails here as well.

I rarely use any other terminal but the native ConTeXt one, so I
didn't notice the problem with metapost terminal.

I'll take a look into it. I get the following error and will try to
investigate further:

This is pdfTeX, Version 3.1415926-1.40.10 (Web2C 2009)
 \write18 enabled.
---! /context/tex/texmf-osx-64/web2c/pdftex/mptopdf.fmt doesn't match
pdftex.pool
(Fatal format file error; I'm stymied)

MPtoPDF 1.4.0 : error while processing tex file

Mojca

PS: I have to admit that I have no idea when I last compiled the
windows binary for gnuplot. I would need to learn again how to do it.
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Gnuplot module: Patching of Gnuplot binary still needed?

2011-01-09 Thread Aditya Mahajan

On Sun, 9 Jan 2011, Mojca Miklavec wrote:


On Sun, Jan 9, 2011 at 22:50,  jeroen.mus...@hotmail.com wrote:

In the past I was using this instruction set to install GnuPlot in Windows 
Context Mkiv minimals but it does not work anymore. Is there a bug in t-gnuplot 
version 2009-07-21?


Thanks a lot for the bug report. I can confirm that it fails here as well.

I rarely use any other terminal but the native ConTeXt one, so I
didn't notice the problem with metapost terminal.

I'll take a look into it. I get the following error and will try to
investigate further:

This is pdfTeX, Version 3.1415926-1.40.10 (Web2C 2009)
\write18 enabled.
---! /context/tex/texmf-osx-64/web2c/pdftex/mptopdf.fmt doesn't match
pdftex.pool
(Fatal format file error; I'm stymied)

MPtoPDF 1.4.0 : error while processing tex file


texexec --make --all

should regenerate mptopdf format.

Aditya
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Gnuplot module: Patching of Gnuplot binary still needed?

2011-01-09 Thread Mojca Miklavec
On Sun, Jan 9, 2011 at 19:54, Mojca Miklavec
mojca.miklavec.li...@gmail.com wrote:
 On Sun, Jan 9, 2011 at 22:50,  jeroen.mus...@hotmail.com wrote:
 In the past I was using this instruction set to install GnuPlot in Windows 
 Context Mkiv minimals but it does not work anymore. Is there a bug in 
 t-gnuplot version 2009-07-21?

 Thanks a lot for the bug report. I can confirm that it fails here as well.

 I rarely use any other terminal but the native ConTeXt one, so I
 didn't notice the problem with metapost terminal.

 I'll take a look into it.

Does it help if you change
\getfiguredimensions[\@@GNUPLOTresult]
into
\getfiguredimensions[\@@GNUPLOTfinalresult]
in line 484?

Mojca
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Gnuplot module: Patching of Gnuplot binary still needed?

2010-11-22 Thread Mojca Miklavec
On Fri, Nov 19, 2010 at 00:38, Florian Wobbe wrote:

 Thanks, I just updated the CVS version of gnuplot with your files and gave it 
 a try: It works with minimals!

 [...]

 Feedback and patches welcome!

 No patches I'm afraid. But feedback goes here:

 1) The label text of the following key element takes the color of the 
 preceding key symbol. Minimal example:

  set terminal lua tikz fulldoc size 15cm,7cm context
  set output 'plot.tex'
  set xrange [ 0 : 13 ]
  f1(x)=sqrt(x)
  f2(x)=sqrt(x*0.8)-3
  plot f1(x) lc rgb 'blue', f2(x)

Confirmed. I had the problems with that in my terminal as well, but I
think that it was a buglet in metapost back then; oh, good old
memories ... :) :) :) I didn't check the details about this one.

 2) Negative axis labels are set with hyphen instead of proper minus sign, 
 which should be longer (see example above).

I'm not sure if this should really be fixed automatically or not. In
order to fix this one would have to patch gnuplot core.

I forgot the details how to do it (I can find it out), but you can
configure the layout of labels. In particular you may enclose the
number into math delimiters ($). Maybe something like
set format y $%.1f$
would work (you might want to change the size of left margin then).
Doing any other kind of magic would be a bit dangerous. Keep in mind
that
plot 'x.dat' u 1:(2*$2)
will also fail since TeX will interpret $ as math delimiter. But
changing that behaviour would have other undesirable effects.

 3) First I thought luatex hangs but then I noticed TikZ is awfully slow when 
 drawing plots with large amounts of data points (the tikzpicture had about 
 3000 lines). I can speed this up by reducing the size by invoking plot with:

  plot  gawk '(NR-1)%10 == 0 {print $0}' fileWithLotsOfData using [...]

 I wonder if there is a smarter way to do this in gnuplot.

Using bitmap terminals. A while back I was dreaming about having
mixed-mode with one terminal creating text labels and the other one
(png for example) drawing the plot. But this needs some extra
programming effort.

You would stumble against the same problem when using PS or PDF
terminal, maybe only at a slightly bigger number of points.

What I did for my theory of chaos reports and the million-of-points
plots in my thesis was to create an empty plot with ConTeXt terminal,
create a borderless plot with PNG and then manually insert PNG into
the generated ConTeXt output, which you could do with TikZ output as
well. It requires more effort, but there is no other way to speed up
vector graphics. They are simply not suitable for drawing millions of
points on the same plot.

(Gnuplot also has a keyword 'every' to reduce the number of points,
but in my case I wanted to plot all of them.)

Mojca
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Gnuplot module: Patching of Gnuplot binary still needed?

2010-11-22 Thread Florian Wobbe
On Nov 22, 2010, at 16:01 , Mojca Miklavec wrote:

 [...]
 
 2) Negative axis labels are set with hyphen instead of proper minus sign, 
 which should be longer (see example above).
 
 I'm not sure if this should really be fixed automatically or not. In
 order to fix this one would have to patch gnuplot core.
 
 I forgot the details how to do it (I can find it out), but you can
 configure the layout of labels. In particular you may enclose the
 number into math delimiters ($). Maybe something like
set format y $%.1f$
 would work (you might want to change the size of left margin then).

Hej Mojca, thank you for your answer! Well, that was surprisingly easy - I 
should have checked the manual first (I was just about to write an ugly hack 
into your context terminal driver :). Actually
 set format $%g$
gives the default label format (only enclosed in $) for all axes.

 Doing any other kind of magic would be a bit dangerous. Keep in mind
 that
plot 'x.dat' u 1:(2*$2)
 will also fail since TeX will interpret $ as math delimiter. But
 changing that behaviour would have other undesirable effects.
 
 3) First I thought luatex hangs but then I noticed TikZ is awfully slow when 
 drawing plots with large amounts of data points (the tikzpicture had about 
 3000 lines). I can speed this up by reducing the size by invoking plot with:
 
  plot  gawk '(NR-1)%10 == 0 {print $0}' fileWithLotsOfData using [...]
 
 I wonder if there is a smarter way to do this in gnuplot.
 
 [...]
 What I did for my theory of chaos reports and the million-of-points
 plots in my thesis was to create an empty plot with ConTeXt terminal,
 create a borderless plot with PNG and then manually insert PNG into
 the generated ConTeXt output, which you could do with TikZ output as
 well. It requires more effort, but there is no other way to speed up
 vector graphics. They are simply not suitable for drawing millions of
 points on the same plot.

I'd probably do the same in that case. But unlike you I have a lot less points 
- 5000 points instead of millions. Loot at this example, which is the slightly 
modified random demo script taken from the gnuplot page:

 set terminal context size 15.0cm,10.5cm standalone
 set output 'randomCtx.tex'

 set dummy t,y
 unset key
 set parametric
 set samples 5000, 5000
 set style function dots
 set title Lattice test for random numbers 
 set xlabel rand(n) - 
 set xrange [ 0.0 : 1.0 ] noreverse nowriteback
 set ylabel rand(n + 1) - 
 set yrange [ 0.0 : 1.0 ] noreverse nowriteback
 set zlabel rand(n + 2) - 
 set zrange [ 0.0 : 1.0 ] noreverse nowriteback
 plot rand(0), rand(0)

 set terminal lua tikz context size 15.0cm,10.5cm fulldoc
 set output 'randomLua.tex'

 replot

Now look at the timing of processing the output files with context (final run 
only):

context randomCtx.tex - 3.150 seconds.
context randomLua.tex - 23.658 seconds.

Further increasing the number of points to 15000 results in 8.978 vs. 62.878 
seconds. Quite a big difference in processing time!

 (Gnuplot also has a keyword 'every' to reduce the number of points,
 but in my case I wanted to plot all of them.)

True, but suppose you don't have evenly spaced data points. Then you don't want 
every other line but one point every 5 kilometres or something the like.

Especially for line drawings it would be beneficial not to place every single 
point. Instead consecutive points should be skipped if they are close to each 
other (with regard to plot units) - it makes no sense to include points which 
you won't see anyway. This could be done by defining a grid with a certain 
(user defined) resolution and rounding the coordinates (plot units) of a line 
point to the nearest grid node. All consecutive line points falling on the same 
grid node should not be passed on to terminal drivers. The psxy utility of GMT 
(http://gmt.soest.hawaii.edu/) does this for instance. I am not aware of such a 
functionality within gnuplot but it would be a nice feature.

Best wishes,
Florian

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Gnuplot module: Patching of Gnuplot binary still needed?

2010-11-22 Thread Mojca Miklavec
On Mon, Nov 22, 2010 at 20:15, Florian Wobbe wrote:

 Especially for line drawings it would be beneficial not to place every single 
 point. Instead consecutive points should be skipped if they are close to each 
 other (with regard to plot units) - it makes no sense to include points which 
 you won't see anyway. This could be done by defining a grid with a certain 
 (user defined) resolution and rounding the coordinates (plot units) of a line 
 point to the nearest grid node. All consecutive line points falling on the 
 same grid node should not be passed on to terminal drivers. The psxy utility 
 of GMT (http://gmt.soest.hawaii.edu/) does this for instance. I am not aware 
 of such a functionality within gnuplot but it would be a nice feature.

But this is an issue of Gnuplot, not something that a terminal writer
is supposed to think of.

One thing that I did implement in ConTeXt was that if I get instructions
   move_to(10,3)
   line_to(11,8)
   line_to(11,8)
   line_to(11,9)
then one line_to(11,8) will be ignored (resolution is hard-coded in
the terminal, but you could draw a smaller plot and then magnify it
which would seemingly decrease resolution). But in most cases that
wouldn't really help.

About the timing difference between set term context and set term
lua context: it is quite possible that metapost library is much
faster than TikZ which uses TeX-based macros. TeX might be slower in
calculations than metapost (which uses C for low level calculations)
and TikZ is not optimized for drawing ten-thousand segments. And Hans
really tried hard to optimize the code. Processing the output with
ConTeXt is also at least ten times slower that outputting straight to
PS or PDF and if you try ConTeXt MKII it is about two times slower
than MKIV.

You probably didn't have a chance to try the first implementations of
ConTeXt terminal for gnuplot. It needed 10 minutes for 13 ordinary
plots and it ran out of memory if I tried to plot 14 of them!!! (The
reason was the usage of btex text etex constructs which lead to
ConTeXt runs inside metapost runs inside ConTeXt runs, all doubled,
maybe the labels were compile even four times, usually with a separate
instance of ConTeXt for each plot.) Now compare that speed difference
and the enormous optimization that Hans implemented back in 2006 ...

The slow speed of TikZ is not something that you could do much about.
There might be some tiny room for optimization in
gnuplot-lua-tikz-common.tex, but hardly any. LuaTeX-based TikZ could
be reimplemented and that would bring most benefits, but since Till
almost-quit the project and since it works out-of-the-box with pdfTeX
macros it is highly unlikely to happen.

But yes, it would be nice if also ConTeXt terminal would be included.
It still doesn't support raw images, but most other features are
present.

Mojca
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Gnuplot module: Patching of Gnuplot binary still needed?

2010-11-22 Thread Aditya Mahajan

On Mon, 22 Nov 2010, Mojca Miklavec wrote:


The slow speed of TikZ is not something that you could do much about.


Rewrite the pgf backend code in metapost.

Aditya
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Gnuplot module: Patching of Gnuplot binary still needed?

2010-11-22 Thread Mojca Miklavec
On Mon, Nov 22, 2010 at 22:19, Aditya Mahajan wrote:
 On Mon, 22 Nov 2010, Mojca Miklavec wrote:

 The slow speed of TikZ is not something that you could do much about.

 Rewrite the pgf backend code in metapost.

But that requires Till (maybe Hans) or some other genius to work on it
for some non-trivial amount time. And that is not likely to happen any
time soon.

Peter as the author of TikZ terminal for gnuplot is certanly not the
one that could be adressed to speed up his terminal.

Mojca
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Gnuplot module: Patching of Gnuplot binary still needed?

2010-11-22 Thread Florian Wobbe
On Nov 22, 2010, at 22:03 , Mojca Miklavec wrote:

 On Mon, Nov 22, 2010 at 20:15, Florian Wobbe wrote:
 
 Especially for line drawings it would be beneficial not to place every 
 single point. Instead consecutive points should be skipped if they are close 
 to each other (with regard to plot units) - it makes no sense to include 
 points which you won't see anyway. This could be done by defining a grid 
 with a certain (user defined) resolution and rounding the coordinates (plot 
 units) of a line point to the nearest grid node. All consecutive line points 
 falling on the same grid node should not be passed on to terminal drivers. 
 The psxy utility of GMT (http://gmt.soest.hawaii.edu/) does this for 
 instance. I am not aware of such a functionality within gnuplot but it would 
 be a nice feature.
 
 But this is an issue of Gnuplot, not something that a terminal writer
 is supposed to think of.

Indeed, this was my point in the first place. It should be handled by gnuplot 
prior to handing the data over to the terminal driver.

 But yes, it would be nice if also ConTeXt terminal would be included.
 It still doesn't support raw images, but most other features are
 present.

Right, this might help increase the awareness among academics. Also not 
everyone has the ability to build gnuplot from sources.

Florian

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Gnuplot module: Patching of Gnuplot binary still needed?

2010-11-22 Thread Mojca Miklavec
On Mon, Nov 22, 2010 at 22:44, Florian Wobbe wrote:
 On Nov 22, 2010, at 22:03 , Mojca Miklavec wrote:
 On Mon, Nov 22, 2010 at 20:15, Florian Wobbe wrote:

 Especially for line drawings it would be beneficial not to place every 
 single point. Instead consecutive points should be skipped if they are 
 close to each other (with regard to plot units) - it makes no sense to 
 include points which you won't see anyway. This could be done by defining a 
 grid with a certain (user defined) resolution and rounding the coordinates 
 (plot units) of a line point to the nearest grid node. All consecutive line 
 points falling on the same grid node should not be passed on to terminal 
 drivers. The psxy utility of GMT (http://gmt.soest.hawaii.edu/) does this 
 for instance. I am not aware of such a functionality within gnuplot but it 
 would be a nice feature.

 But this is an issue of Gnuplot, not something that a terminal writer
 is supposed to think of.

 Indeed, this was my point in the first place. It should be handled by gnuplot 
 prior to handing the data over to the terminal driver.

However you need to write to gnuplot-dev then. This mailing list
cannot help you.

 But yes, it would be nice if also ConTeXt terminal would be included.
 It still doesn't support raw images, but most other features are
 present.

 Right, this might help increase the awareness among academics. Also not 
 everyone has the ability to build gnuplot from sources.

But as I said ... there have to be others writing on gnuplot-dev to
show interest to other gnuplot developers. I will continue to work
with Peter to improve TikZ output and to include support into
t-gnuplot.tex, but comparison such as the speed test demonstrated with
those random points (sent to dev-gnuplot) may help.

Mojca
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Gnuplot module: Patching of Gnuplot binary still needed?

2010-11-22 Thread Alan BRASLAU
On Monday 22 November 2010 22:19:40 Aditya Mahajan wrote:
 On Mon, 22 Nov 2010, Mojca Miklavec wrote:
  The slow speed of TikZ is not something that you could do much about.
 
 Rewrite the pgf backend code in metapost.
 

Or use metapost: \usemodule [graph]

Alan
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Gnuplot module: Patching of Gnuplot binary still needed?

2010-11-22 Thread Ethan Merritt
On Monday, November 22, 2010 07:01:07 am Mojca Miklavec wrote:
 On Fri, Nov 19, 2010 at 00:38, Florian Wobbe wrote:
 
  Thanks, I just updated the CVS version of gnuplot with your files and gave 
  it a try: It works with minimals!
 
  [...]
 
  Feedback and patches welcome!
 
  No patches I'm afraid. But feedback goes here:
 
  1) The label text of the following key element takes the color of the 
  preceding key symbol. Minimal example:
 
   set terminal lua tikz fulldoc size 15cm,7cm context
   set output 'plot.tex'
   set xrange [ 0 : 13 ]
   f1(x)=sqrt(x)
   f2(x)=sqrt(x*0.8)-3
   plot f1(x) lc rgb 'blue', f2(x)
 
 Confirmed. I had the problems with that in my terminal as well, but I
 think that it was a buglet in metapost back then; oh, good old
 memories ... :) :) :) I didn't check the details about this one.
 
  2) Negative axis labels are set with hyphen instead of proper minus sign, 
  which should be longer (see example above).
 
 I'm not sure if this should really be fixed automatically or not. In
 order to fix this one would have to patch gnuplot core.
 
 I forgot the details how to do it (I can find it out), but you can
 configure the layout of labels. In particular you may enclose the
 number into math delimiters ($). Maybe something like
 set format y $%.1f$
 would work (you might want to change the size of left margin then).
 Doing any other kind of magic would be a bit dangerous. Keep in mind
 that
 plot 'x.dat' u 1:(2*$2)
 will also fail since TeX will interpret $ as math delimiter. But
 changing that behaviour would have other undesirable effects.
 
  3) First I thought luatex hangs but then I noticed TikZ is awfully slow 
  when drawing plots with large amounts of data points (the tikzpicture had 
  about 3000 lines). I can speed this up by reducing the size by invoking 
  plot with:
 
   plot  gawk '(NR-1)%10 == 0 {print $0}' fileWithLotsOfData using [...]
 
  I wonder if there is a smarter way to do this in gnuplot.
 
 Using bitmap terminals. A while back I was dreaming about having
 mixed-mode with one terminal creating text labels and the other one
 (png for example) drawing the plot. But this needs some extra
 programming effort.

As I recall, I posted a patch the last time this discussion came up.
It turns off text output from the png terminal without affecting any
other graphical elements.  My though was that it could be the basis
of a pdflatex terminal class that works the same way as the current
epslatex terminals.  I can post it again, or upload it to SourceForge
if it isn't there already.

Ethan


 
 You would stumble against the same problem when using PS or PDF
 terminal, maybe only at a slightly bigger number of points.
 
 What I did for my theory of chaos reports and the million-of-points
 plots in my thesis was to create an empty plot with ConTeXt terminal,
 create a borderless plot with PNG and then manually insert PNG into
 the generated ConTeXt output, which you could do with TikZ output as
 well. It requires more effort, but there is no other way to speed up
 vector graphics. They are simply not suitable for drawing millions of
 points on the same plot.
 
 (Gnuplot also has a keyword 'every' to reduce the number of points,
 but in my case I wanted to plot all of them.)
 
 Mojca
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Gnuplot module: Patching of Gnuplot binary still needed?

2010-11-18 Thread Paul Menzel
Am Montag, den 15.11.2010, 12:29 +0100 schrieb Mojca Miklavec:
 On Sun, Nov 14, 2010 at 23:04, Paul Menzel wrote:

  I read about the Gnuplot module [1] and I am wondering whether patching
  the Gnuplot binary is still necessary.
 
 Yes.
 
 Can you please send the same message to the gnuplot mailing list?

I will.

 I have sent the patch upstream once in 2006,

Could you please tell me subject line or even better provide a link to
the archive. I could not find your post to the archive.

 but they had two arguments against including the patch:

[…]


Thanks,

Paul


signature.asc
Description: This is a digitally signed message part
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Gnuplot module: Patching of Gnuplot binary still needed?

2010-11-18 Thread Florian Wobbe
On Nov 17, 2010, at 11:47 , Mojca Miklavec wrote:

 [...]

 Here is a brief list of changes to the gnuplot CVS version:
 
 * support for ConTeXt and plain TeX
 
 Hurray! Thanks a lot.
 
 * removed dependencies for LaTeX packages other than TikZ
 * needs TikZ Version = 2.0
 * better support for saving terminal options with gnuplot 'save' command
 * fixed overflow on negative coordinates that are outside of the crop box
 * merged all recent patched from murphy-md and Ethan
 
 Unfortunately it is the Context output that does not compile with the most
 recent Context version I installed from TeXLive 2010 and the
 http://tlcontrib.metatex.org/2010/ repository. But I remember it working
 with an older version so I hope this can be fixed easily ...

Thanks, I just updated the CVS version of gnuplot with your files and gave it a 
try: It works with minimals!

 [...]
 
 Feedback and patches welcome!

No patches I'm afraid. But feedback goes here:

1) The label text of the following key element takes the color of the preceding 
key symbol. Minimal example:

 set terminal lua tikz fulldoc size 15cm,7cm context
 set output 'plot.tex'
 set xrange [ 0 : 13 ]
 f1(x)=sqrt(x)
 f2(x)=sqrt(x*0.8)-3
 plot f1(x) lc rgb 'blue', f2(x) 

2) Negative axis labels are set with hyphen instead of proper minus sign, which 
should be longer (see example above).

3) First I thought luatex hangs but then I noticed TikZ is awfully slow when 
drawing plots with large amounts of data points (the tikzpicture had about 3000 
lines). I can speed this up by reducing the size by invoking plot with:

 plot  gawk '(NR-1)%10 == 0 {print $0}' fileWithLotsOfData using [...]

I wonder if there is a smarter way to do this in gnuplot.

4) Is there a possibility to get rid of the vertical artifacts in filledcurves? 
Note: the artifacts are only visible when plotting from data files.

 set terminal lua tikz fulldoc size 15cm,7cm context 
 set output 'plot.tex'
 plot  gawk 'BEGIN {for (i = 1; i = 100; i++) {print i, 0.7*i, 0.8*i+50}}' 
using 1:2:3 with filledcurve lc rgb 'black' t 'filled curve'
 set xrange [ 0 : 13 ]
 plot abs(x) with filledcurve xy=2,5

Best wishes,
Florian

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Gnuplot module: Patching of Gnuplot binary still needed?

2010-11-17 Thread Jonas Stein

 2.) they assumed that I was the only user

That might be true until its implemented and public known.
I suppose thousands will like that function. Students will love it.

Kind regards,

-- 
Jonas Stein n...@jonasstein.de

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Gnuplot module: Patching of Gnuplot binary still needed?

2010-11-15 Thread Mojca Miklavec
On Sun, Nov 14, 2010 at 23:04, Paul Menzel wrote:
 Dear ConTeXt folks,


 I read about the Gnuplot module [1] and I am wondering whether patching
 the Gnuplot binary is still necessary.

Yes.

Can you please send the same message to the gnuplot mailing list?

I have sent the patch upstream once in 2006, but they had two
arguments against including the patch:

1.) nobody from the development team was willing to install anything
else but tetex to try it out (and the module doesn't work under tetex)

2.) they assumed that I was the only user

The first point should hopefully be resolved by now (module should
work under MikTeX or TeX Live out-of-the-box and hopefully TeX Live is
enough widespread by now), but if anyone wants to have the module
included, somebody else but me needs to write to the gnuplot mailing
list and ask the developers if they are willing to include the patch.
(By pointing them to
https://github.com/mojca/gnuplot/blob/master/term/context.trm first.)

I'm willing to upload the patch, but it makes no sense for me to
regularly upload new patches to their
feature-requests-and-bug-tracking system if they ignore them for ages
...
I admit that the number of ConTeXt/Gnuplot users might be small, alone
for the fact that the number of ConTeXt users (several thousand?) is
much smaller than the number of LaTeX addicts, but I would be glad to
see 20 users of metafont terminal when not even the output of metapost
terminal is satisfactory (it could be improved considerably).


Apart from that ... I was working with Peter Hedwig on the ConTeXt
part of his lua/TikZ terminal (that has already been included in
gnuplot). We got it running, with some issues like general font
loading scheme, but the work was never polished to the end (stalled at
some point). We could revive that thread as well.

 Github is currently down and

It works here, but the main gnuplot code is located on fontforge (in
CVS). Github only includes a patched version of gnuplot that contains
context support.

Mojca

 therefore cannot check if the code is included. But judging from

        gnuplot help terminal
        […]
        Subtopics available for terminal:
            canvas            cgm               corel             dpu414
            dumb              dxf               eepic             emf
            emtex             epslatex          epson_180dpi      epson_60dpi
            epson_lx800       fig               gif               gpic
            hp2623a           hp2648            hp500c            hpdj
            hpgl              hpljii            hppj              imagen
            jpeg              latex             mf                mif
            mp                nec_cp6           okidata           pbm
            pcl5              pdfcairo          png               pngcairo
            pop               postscript        pslatex           pstex
            pstricks          push              qms               regis
            starc             svg               tandy_60dpi       tek40xx
            tek410x           texdraw           tgif              tkcanvas
            tpic              vttek             wxt               x11
            xlib              xterm

        $ gnuplot --version
        gnuplot 4.4 patchlevel 0

 it appears it is still required. Did some send this patch already
 upstream for inclusion?


 Thanks,

 Paul

 [1] http://wiki.contextgarden.net/Gnuplot
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] gnuplot module

2008-04-17 Thread Mojca Miklavec
On Wed, Apr 16, 2008 at 9:24 PM, John Devereux wrote:
 Mojca Miklavec writes:

  I really like gnuplot and the gnuplot module. It is great to be able
  to include the data inline with the document. And it would be nice to
  see it part of the distribution. I am using a stock debian gnuplot, so
  I don't know the implications of the context and TikZ terminals.

No major difference. But it would (should, at least) be compatible
with all the three: LaTeX/plain/ConTeXt.

  Does
  it mean I would not end up with so many  *-gnuplot-* files? :)

When I have developed the terminal with enormous Hans's and Taco's
help, I have asked him to implement some functionality to delete the
files with ctxtools --purge. He has implemented some functionality
(\registertempfile or something - need to check), but it deletes the
files automatically at the end of run, so one either needs to:
- delete the files
- leave the files
- no option to delete files with ctxtools
The problem with deleting the files immediately is that if you make a
trivial mistake in the gnuplot script, gnuplot won't create any
output, and it's rather difficult to spot the error in the long bunch
of ConTeXt messages. You just get no graphic, any you wonder why.

Do you have any suggestions about how to reduce the number of files in
some sensible way?

Mojca
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] gnuplot module

2008-04-17 Thread Mojca Miklavec
On Thu, Apr 17, 2008 at 4:27 PM, John Devereux wrote:
 Mojca Miklavec writes:

   Do you have any suggestions about how to reduce the number of files in
   some sensible way?

  The ideal would be an option when processing the source file, to turn
  off file deletion. Like

  texexec document.tex --keep-temporaries

  So by default the source directory would be kept clean, but when
  debugging the intermediate files would be available.

  Or perhaps some option passed to \startGNUPLOTscript (or
  \useGNUPLOTgraphic) if that is possible?

   \startGNUPLOTscript[example][keeptemporaryfile=yes]

This sounds fine (having a --debug-like option), but one more question
- what about caching existing results? (If all files are deleted, then
it's not possible to ask for --ifchanged, so gnuplot needs to be run
each time.)

  That might be better otherwise debugging a big document could result
  it hundreds of files.

  Another possibility would be to put the files in /tmp.

That's not too practical.

Mojca
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] gnuplot module

2008-04-17 Thread John Devereux
Mojca Miklavec [EMAIL PROTECTED] writes:

 On Thu, Apr 17, 2008 at 4:27 PM, John Devereux wrote:
 Mojca Miklavec writes:

   Do you have any suggestions about how to reduce the number of files in
   some sensible way?

  The ideal would be an option when processing the source file, to turn
  off file deletion. Like

  texexec document.tex --keep-temporaries

  So by default the source directory would be kept clean, but when
  debugging the intermediate files would be available.

  Or perhaps some option passed to \startGNUPLOTscript (or
  \useGNUPLOTgraphic) if that is possible?

   \startGNUPLOTscript[example][keeptemporaryfile=yes]

 This sounds fine (having a --debug-like option), but one more question
 - what about caching existing results? (If all files are deleted, then
 it's not possible to ask for --ifchanged, so gnuplot needs to be run
 each time.)

Actually the configurable temp dir would be OK too.

  texexec document.tex --tempdir=./temporaries

Regarding cacheing, this would be nice but I don't know if it can be
done. I think you still need to run gnuplot in case the data has
changed.

  That might be better otherwise debugging a big document could result
  it hundreds of files.

  Another possibility would be to put the files in /tmp.

 That's not too practical.



-- 

John Devereux
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___