ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* LMTX and addplot table
@ 2020-12-12  9:36 Jean-Philippe Rey
  2020-12-12 10:58 ` Hans Hagen
  0 siblings, 1 reply; 7+ messages in thread
From: Jean-Philippe Rey @ 2020-12-12  9:36 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 965 bytes --]

Dear list,

I am unable to draw a plot using an external file with LMTX. Here is a minimal example

=====================
\usemodule[pgfplots]
\starttext
\starttikzpicture
\startaxis
\addplot table [x=t, y=E] {mfe-addplot.dat};
\stopaxis
\stoptikzpicture
\stoptext
=====================

The ConTeXt run fails with an "Undefined control sequence" error (see attached log file). I don't know if this is an LMTX or PGF issue. The example works fine with MkIV. I tried with the tikz version available on ConTeXt garden (pgf 3.0.1, pgfplots 1.16) and the last one from CTAN (pgf 3.1.7a, pgfplots 1.17) with the same result.

The same example works fine if I provide the data inline. This looks like a problem while reading the data file.

Thanks for your insight.

Best regards,

-- 
Jean-Philippe Rey
jean-philippe.rey@centralesupelec.fr
91192 Gif-sur-Yvette Cedex - France
Empreinte PGP : 807A 5B2C 69E4 D4B5 783A 428A 1B5E E83E 261B BF51

[-- Attachment #2: mfe-addplot.dat --]
[-- Type: application/ms-tnef, Size: 20 bytes --]

[-- Attachment #3: mfe-addplot.log --]
[-- Type: application/octet-stream, Size: 19024 bytes --]

system          > 
system          > ConTeXt  ver: 2020.12.10 22:26 LMTX  fmt: 2020.12.12  int: english/english
system          > 
system          > 'cont-new.mkxl' loaded
open source     > level 1, order 1, name '/Users/jprey/Applications/ConTeXt/2020-LMTX/tex/texmf-context/tex/context/base/mkxl/cont-new.mkxl'
system          > beware: some patches loaded from cont-new.mkiv
close source    > level 1, order 1, name '/Users/jprey/Applications/ConTeXt/2020-LMTX/tex/texmf-context/tex/context/base/mkxl/cont-new.mkxl'
system          > files > jobname 'mfe-addplot', input './mfe-addplot', result 'mfe-addplot'
fonts           > latin modern fonts are not preloaded
languages       > language 'en' is active
open source     > level 1, order 2, name './mfe-addplot.tex'
modules         > 'pgfplots' is loaded
open source     > level 2, order 3, name '/Users/jprey/Applications/ConTeXt/2020-LMTX/tex/texmf-modules/tex/context/third/pgfplots/t-pgfplots.tex'
loading         > ConTeXt User Module / Pgfplots
open source     > level 3, order 4, name 'pgfplots.revision.tex'
close source    > level 3, order 4, name 'pgfplots.revision.tex'
modules         > 'tikz' is loaded
open source     > level 3, order 5, name '/Users/jprey/Applications/ConTeXt/2020-LMTX/tex/texmf-modules/tex/context/third/pgf/frontendlayer/t-tikz.tex'
loading         > ConTeXt User Module / tikz
open source     > level 4, order 6, name 't-pgf.tex'
loading         > ConTeXt User Module / pgf
open source     > level 5, order 7, name 't-pgfcor.tex'
loading         > ConTeXt User Module / pgfcor
open source     > level 6, order 8, name 't-pgfsys.tex'
loading         > ConTeXt User Module / pgfsys
open source     > level 7, order 9, name 't-pgfrcs.tex'
loading         > ConTeXt User Module / pgfrcs
open source     > level 8, order 10, name 't-pgfmod.tex'
loading         > ConTeXt User Module / pgfmodules
close source    > level 8, order 10, name 't-pgfmod.tex'
open source     > level 8, order 11, name 'pgfutil-common.tex'
open source     > level 9, order 12, name 'pgfutil-common-lists.tex'
close source    > level 9, order 12, name 'pgfutil-common-lists.tex'
close source    > level 8, order 12, name 'pgfutil-common.tex'
open source     > level 8, order 13, name 'pgfutil-context.def'
close source    > level 8, order 13, name 'pgfutil-context.def'
open source     > level 8, order 14, name 'pgfrcs.code.tex'
open source     > level 9, order 15, name 'pgf.revision.tex'
close source    > level 9, order 15, name 'pgf.revision.tex'
close source    > level 8, order 15, name 'pgfrcs.code.tex'
close source    > level 7, order 15, name 't-pgfrcs.tex'
open source     > level 7, order 16, name 'pgfsys.code.tex'
open source     > level 8, order 17, name 'pgfkeys.code.tex'
open source     > level 9, order 18, name 'pgfkeysfiltered.code.tex'
close source    > level 9, order 18, name 'pgfkeysfiltered.code.tex'
close source    > level 8, order 18, name 'pgfkeys.code.tex'
open source     > level 8, order 19, name 'pgf.cfg'
close source    > level 8, order 19, name 'pgf.cfg'
Driver file for pgf: pgfsys-luatex.def

open source     > level 8, order 20, name 'pgfsys-luatex.def'
open source     > level 9, order 21, name 'pgfsys-common-pdf.def'
close source    > level 9, order 21, name 'pgfsys-common-pdf.def'
close source    > level 8, order 21, name 'pgfsys-luatex.def'
close source    > level 7, order 21, name 'pgfsys.code.tex'
open source     > level 7, order 22, name 'pgfsyssoftpath.code.tex'
close source    > level 7, order 22, name 'pgfsyssoftpath.code.tex'
open source     > level 7, order 23, name 'pgfsysprotocol.code.tex'
close source    > level 7, order 23, name 'pgfsysprotocol.code.tex'
close source    > level 6, order 23, name 't-pgfsys.tex'
open source     > level 6, order 24, name 'pgfcore.code.tex'
open source     > level 7, order 25, name 'pgfmath.code.tex'
open source     > level 8, order 26, name 'pgfmathcalc.code.tex'
open source     > level 9, order 27, name 'pgfmathutil.code.tex'
close source    > level 9, order 27, name 'pgfmathutil.code.tex'
open source     > level 9, order 28, name 'pgfmathparser.code.tex'
close source    > level 9, order 28, name 'pgfmathparser.code.tex'
open source     > level 9, order 29, name 'pgfmathfunctions.code.tex'
open source     > level 10, order 30, name 'pgfmathfunctions.basic.code.tex'
close source    > level 10, order 30, name 'pgfmathfunctions.basic.code.tex'
open source     > level 10, order 31, name 'pgfmathfunctions.trigonometric.code.tex'
close source    > level 10, order 31, name 'pgfmathfunctions.trigonometric.code.tex'
open source     > level 10, order 32, name 'pgfmathfunctions.random.code.tex'
close source    > level 10, order 32, name 'pgfmathfunctions.random.code.tex'
open source     > level 10, order 33, name 'pgfmathfunctions.comparison.code.tex'
close source    > level 10, order 33, name 'pgfmathfunctions.comparison.code.tex'
open source     > level 10, order 34, name 'pgfmathfunctions.base.code.tex'
close source    > level 10, order 34, name 'pgfmathfunctions.base.code.tex'
open source     > level 10, order 35, name 'pgfmathfunctions.round.code.tex'
close source    > level 10, order 35, name 'pgfmathfunctions.round.code.tex'
open source     > level 10, order 36, name 'pgfmathfunctions.misc.code.tex'
close source    > level 10, order 36, name 'pgfmathfunctions.misc.code.tex'
open source     > level 10, order 37, name 'pgfmathfunctions.integerarithmetics.code.tex'
close source    > level 10, order 37, name 'pgfmathfunctions.integerarithmetics.code.tex'
close source    > level 9, order 37, name 'pgfmathfunctions.code.tex'
close source    > level 8, order 37, name 'pgfmathcalc.code.tex'
open source     > level 8, order 38, name 'pgfmathfloat.code.tex'
close source    > level 8, order 38, name 'pgfmathfloat.code.tex'
close source    > level 7, order 38, name 'pgfmath.code.tex'
open source     > level 7, order 39, name 'pgfint.code.tex'
close source    > level 7, order 39, name 'pgfint.code.tex'
open source     > level 7, order 40, name 'pgfcorepoints.code.tex'
close source    > level 7, order 40, name 'pgfcorepoints.code.tex'
open source     > level 7, order 41, name 'pgfcorepathconstruct.code.tex'
close source    > level 7, order 41, name 'pgfcorepathconstruct.code.tex'
open source     > level 7, order 42, name 'pgfcorepathusage.code.tex'
close source    > level 7, order 42, name 'pgfcorepathusage.code.tex'
open source     > level 7, order 43, name 'pgfcorescopes.code.tex'
close source    > level 7, order 43, name 'pgfcorescopes.code.tex'
open source     > level 7, order 44, name 'pgfcoregraphicstate.code.tex'
close source    > level 7, order 44, name 'pgfcoregraphicstate.code.tex'
open source     > level 7, order 45, name 'pgfcoretransformations.code.tex'
close source    > level 7, order 45, name 'pgfcoretransformations.code.tex'
open source     > level 7, order 46, name 'pgfcorequick.code.tex'
close source    > level 7, order 46, name 'pgfcorequick.code.tex'
open source     > level 7, order 47, name 'pgfcoreobjects.code.tex'
close source    > level 7, order 47, name 'pgfcoreobjects.code.tex'
open source     > level 7, order 48, name 'pgfcorepathprocessing.code.tex'
close source    > level 7, order 48, name 'pgfcorepathprocessing.code.tex'
open source     > level 7, order 49, name 'pgfcorearrows.code.tex'
close source    > level 7, order 49, name 'pgfcorearrows.code.tex'
open source     > level 7, order 50, name 'pgfcoreshade.code.tex'
close source    > level 7, order 50, name 'pgfcoreshade.code.tex'
open source     > level 7, order 51, name 'pgfcoreimage.code.tex'
open source     > level 8, order 52, name 'pgfcoreexternal.code.tex'
close source    > level 8, order 52, name 'pgfcoreexternal.code.tex'
close source    > level 7, order 52, name 'pgfcoreimage.code.tex'
open source     > level 7, order 53, name 'pgfcorelayers.code.tex'
close source    > level 7, order 53, name 'pgfcorelayers.code.tex'
open source     > level 7, order 54, name 'pgfcoretransparency.code.tex'
close source    > level 7, order 54, name 'pgfcoretransparency.code.tex'
open source     > level 7, order 55, name 'pgfcorepatterns.code.tex'
close source    > level 7, order 55, name 'pgfcorepatterns.code.tex'
open source     > level 7, order 56, name 'pgfcorerdf.code.tex'
close source    > level 7, order 56, name 'pgfcorerdf.code.tex'
close source    > level 6, order 56, name 'pgfcore.code.tex'
close source    > level 5, order 56, name 't-pgfcor.tex'
open source     > level 5, order 57, name 'pgfmoduleshapes.code.tex'
close source    > level 5, order 57, name 'pgfmoduleshapes.code.tex'
open source     > level 5, order 58, name 'pgfmoduleplot.code.tex'
close source    > level 5, order 58, name 'pgfmoduleplot.code.tex'
close source    > level 4, order 58, name 't-pgf.tex'
open source     > level 4, order 59, name 't-pgffor.tex'
loading         > ConTeXt User Module / pgffor
open source     > level 5, order 60, name 't-pgfrcs.tex'
loading         > ConTeXt User Module / pgfrcs
close source    > level 5, order 60, name 't-pgfrcs.tex'
open source     > level 5, order 61, name 't-pgfkey.tex'
loading         > ConTeXt User Module / pgfkey
open source     > level 6, order 62, name 'pgfkeys.code.tex'
close source    > level 6, order 62, name 'pgfkeys.code.tex'
close source    > level 5, order 62, name 't-pgfkey.tex'
open source     > level 5, order 63, name 'pgffor.code.tex'
open source     > level 6, order 64, name 'pgfmath.code.tex'
close source    > level 6, order 64, name 'pgfmath.code.tex'
close source    > level 5, order 64, name 'pgffor.code.tex'
close source    > level 4, order 64, name 't-pgffor.tex'
open source     > level 4, order 65, name 'tikz.code.tex'
open source     > level 5, order 66, name 'pgflibraryplothandlers.code.tex'
close source    > level 5, order 66, name 'pgflibraryplothandlers.code.tex'
open source     > level 5, order 67, name 'pgfmodulematrix.code.tex'
close source    > level 5, order 67, name 'pgfmodulematrix.code.tex'
open source     > level 5, order 68, name 'tikzlibrarytopaths.code.tex'
close source    > level 5, order 68, name 'tikzlibrarytopaths.code.tex'
close source    > level 4, order 68, name 'tikz.code.tex'
close source    > level 3, order 68, name '/Users/jprey/Applications/ConTeXt/2020-LMTX/tex/texmf-modules/tex/context/third/pgf/frontendlayer/t-tikz.tex'
open source     > level 3, order 69, name 'tikzlibraryplotmarks.code.tex'
open source     > level 4, order 70, name 'pgflibraryplotmarks.code.tex'
close source    > level 4, order 70, name 'pgflibraryplotmarks.code.tex'
close source    > level 3, order 70, name 'tikzlibraryplotmarks.code.tex'
open source     > level 3, order 71, name 'pgfplots.code.tex'
open source     > level 4, order 72, name 'pgfplotscore.code.tex'
Package pgfplots info on input line 124: Initializing with LUA version Lua 5.4

open source     > level 5, order 73, name 'pgfplotssysgeneric.code.tex'
close source    > level 5, order 73, name 'pgfplotssysgeneric.code.tex'
close source    > level 4, order 73, name 'pgfplotscore.code.tex'
open source     > level 4, order 74, name 'pgfplotslibrary.code.tex'
close source    > level 4, order 74, name 'pgfplotslibrary.code.tex'
open source     > level 4, order 75, name 'pgfplotsoldpgfsupp_loader.code.tex'
open source     > level 5, order 76, name 'pgflibraryfpu.code.tex'
close source    > level 5, order 76, name 'pgflibraryfpu.code.tex'
open source     > level 5, order 77, name 'pgflibraryluamath.code.tex'
close source    > level 5, order 77, name 'pgflibraryluamath.code.tex'
Package pgfplots info on input line 290: luamath library shipped with pgf 3.1.7a is up-to-date

close source    > level 4, order 77, name 'pgfplotsoldpgfsupp_loader.code.tex'
open source     > level 4, order 78, name 'pgfplotsutil.code.tex'
Package pgfplots info on input line 82: Found new luatex: initializing lua commands instead of write18 (shell-escape)

open source     > level 5, order 79, name 'pgfplotsliststructure.code.tex'
close source    > level 5, order 79, name 'pgfplotsliststructure.code.tex'
open source     > level 5, order 80, name 'pgfplotsliststructureext.code.tex'
close source    > level 5, order 80, name 'pgfplotsliststructureext.code.tex'
open source     > level 5, order 81, name 'pgfplotsarray.code.tex'
close source    > level 5, order 81, name 'pgfplotsarray.code.tex'
open source     > level 5, order 82, name 'pgfplotsmatrix.code.tex'
close source    > level 5, order 82, name 'pgfplotsmatrix.code.tex'
open source     > level 5, order 83, name 'pgfplotstableshared.code.tex'
close source    > level 5, order 83, name 'pgfplotstableshared.code.tex'
open source     > level 5, order 84, name 'pgfplotsdeque.code.tex'
close source    > level 5, order 84, name 'pgfplotsdeque.code.tex'
open source     > level 5, order 85, name 'pgfplotsbinary.code.tex'
open source     > level 6, order 86, name 'pgfplotsbinary.data.code.tex'
close source    > level 6, order 86, name 'pgfplotsbinary.data.code.tex'
close source    > level 5, order 86, name 'pgfplotsbinary.code.tex'
open source     > level 5, order 87, name 'pgfplotsutil.verb.code.tex'
close source    > level 5, order 87, name 'pgfplotsutil.verb.code.tex'
open source     > level 5, order 88, name 'pgflibrarypgfplots.surfshading.code.tex'
open source     > level 6, order 89, name 'pgflibrarypgfplots.surfshading.pgfsys-luatex.def'
close source    > level 6, order 89, name 'pgflibrarypgfplots.surfshading.pgfsys-luatex.def'
close source    > level 5, order 89, name 'pgflibrarypgfplots.surfshading.code.tex'
close source    > level 4, order 89, name 'pgfplotsutil.code.tex'
open source     > level 4, order 90, name 'pgfplotscolormap.code.tex'
open source     > level 5, order 91, name 'pgfplotscolor.code.tex'
close source    > level 5, order 91, name 'pgfplotscolor.code.tex'
close source    > level 4, order 91, name 'pgfplotscolormap.code.tex'
open source     > level 4, order 92, name 'pgfplotsstackedplots.code.tex'
close source    > level 4, order 92, name 'pgfplotsstackedplots.code.tex'
open source     > level 4, order 93, name 'pgfplotsplothandlers.code.tex'
open source     > level 5, order 94, name 'pgfplotsmeshplothandler.code.tex'
open source     > level 6, order 95, name 'pgfplotsmeshplotimage.code.tex'
close source    > level 6, order 95, name 'pgfplotsmeshplotimage.code.tex'
close source    > level 5, order 95, name 'pgfplotsmeshplothandler.code.tex'
close source    > level 4, order 95, name 'pgfplotsplothandlers.code.tex'
open source     > level 4, order 96, name 'pgfplots.scaling.code.tex'
close source    > level 4, order 96, name 'pgfplots.scaling.code.tex'
open source     > level 4, order 97, name 'pgfplotscoordprocessing.code.tex'
close source    > level 4, order 97, name 'pgfplotscoordprocessing.code.tex'
open source     > level 4, order 98, name 'pgfplots.errorbars.code.tex'
close source    > level 4, order 98, name 'pgfplots.errorbars.code.tex'
open source     > level 4, order 99, name 'pgfplots.markers.code.tex'
close source    > level 4, order 99, name 'pgfplots.markers.code.tex'
open source     > level 4, order 100, name 'pgfplotsticks.code.tex'
close source    > level 4, order 100, name 'pgfplotsticks.code.tex'
open source     > level 4, order 101, name 'pgfplots.paths.code.tex'
close source    > level 4, order 101, name 'pgfplots.paths.code.tex'
open source     > level 4, order 102, name 'tikzlibrarydecorations.code.tex'
open source     > level 5, order 103, name 'pgfmoduledecorations.code.tex'
close source    > level 5, order 103, name 'pgfmoduledecorations.code.tex'
close source    > level 4, order 103, name 'tikzlibrarydecorations.code.tex'
open source     > level 4, order 104, name 'tikzlibrarydecorations.pathmorphing.code.tex'
open source     > level 5, order 105, name 'pgflibrarydecorations.pathmorphing.code.tex'
close source    > level 5, order 105, name 'pgflibrarydecorations.pathmorphing.code.tex'
close source    > level 4, order 105, name 'tikzlibrarydecorations.pathmorphing.code.tex'
open source     > level 4, order 106, name 'tikzlibrarydecorations.pathreplacing.code.tex'
open source     > level 5, order 107, name 'pgflibrarydecorations.pathreplacing.code.tex'
close source    > level 5, order 107, name 'pgflibrarydecorations.pathreplacing.code.tex'
close source    > level 4, order 107, name 'tikzlibrarydecorations.pathreplacing.code.tex'
tex memory      > bumping category 'token' succeeded, details: all=8000000 | ini=478464 | max=10000000 | mem=1000000 | min=1000000 | ptr=1012847 | set=10000000 | stp=250000 | top=1000000
close source    > level 3, order 107, name 'pgfplots.code.tex'
close source    > level 2, order 107, name '/Users/jprey/Applications/ConTeXt/2020-LMTX/tex/texmf-modules/tex/context/third/pgfplots/t-pgfplots.tex'
fonts           > preloading latin modern fonts (second stage)
fonts           > 'fallback modern-designsize rm 12pt' is loaded
! Package pgfplots Warning: running in backwards compatibility mode (unsuitable tick labels; missing features). Consider writing \pgfplotsset{compat=1.17} into your preamble.

PGFPlots: reading {mfe-addplot.dat}


tex error       > tex error on line 5 in file ./mfe-addplot.tex: Undefined control sequence


<macro> \pgfplots@error #1->\PackageError 
    {pgfplots}{#1}{}
<macro> \pgfk@/pgfplots/exception/no such element/.@cmd #1#2\pgfeov ->\ifx \pgfplotsexceptionmsg \relax \pgfplots@error {#2}
    \else \pgfplots@error {\pgfplotsexceptionmsg }\fi \let #1=\pgfutil@empty 
<argument> ...le@getcol@next {\pgfplots@plot@tbl@x }\of {\pgfplotstableread@filename }\to {\pgfplots@table@PTR@x }\getcolmethod {getptr}
    \fi \else \pgfplotstable@getcol@next {\pgfplots@plot@tbl@x }\of {\pgfplotstableread@filename }\to {\pgfplots@table@PTR@x }...

<macro> \pgfutil@firstoftwo #1#2->#1
    

<macro> \pgfutil@reserved@b ...bl@xindex }{\pgfplots@table@PTR@x }\else \pgfplotstablereadgetptrtocolname {\pgfplots@plot@tbl@x }{\pgfplots@table@PTR@x }
    \fi \ifx \pgfplots@plot@tbl@y \pgfutil@empty \pgfplotstablereadgetptrtocolindex {\pgfplots@plot@tbl@yindex }{\pgfplots@tab...

<macro> \pgfutil@reserved@b \pgfplots@addplotimpl@table@fromfile@listener@PREPARE 
    \pgfplots@dereferencepointer@and@ASSIGN@x \pgfplots@dereferencepointer@and@ASSIGN@y \pgfplots@dereferencepointer@and@ASSIGN@z \pgfplots@dereferencepointer@and@ASSIGN@meta 
...

<line 3.5> \addplot table [x=t, y=E] {mfe-addplot.dat};
    


1     \usemodule[pgfplots]
2     \starttext
3     \starttikzpicture
4     \startaxis
5 >>  \addplot table [x=t, y=E] {mfe-addplot.dat};
6     \stopaxis
7     \stoptikzpicture
8     \stoptext
9     


The control sequence at the end of the top line of your error message was never
\def'ed. You can just continue as I'll forget about whatever was undefined.



[-- Attachment #4: Type: text/plain, Size: 493 bytes --]

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: LMTX and addplot table
  2020-12-12  9:36 LMTX and addplot table Jean-Philippe Rey
@ 2020-12-12 10:58 ` Hans Hagen
       [not found]   ` <EB02BBB4-B1B6-45B9-BAA1-0729B3651B32@centralesupelec.fr>
  0 siblings, 1 reply; 7+ messages in thread
From: Hans Hagen @ 2020-12-12 10:58 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Jean-Philippe Rey

On 12/12/2020 10:36 AM, Jean-Philippe Rey wrote:
> Dear list,
> 
> I am unable to draw a plot using an external file with LMTX. Here is a minimal example
> 
> =====================
> \usemodule[pgfplots]
> \starttext
> \starttikzpicture
> \startaxis
> \addplot table [x=t, y=E] {mfe-addplot.dat};
> \stopaxis
> \stoptikzpicture
> \stoptext
> =====================
> 
> The ConTeXt run fails with an "Undefined control sequence" error (see attached log file). I don't know if this is an LMTX or PGF issue. The example works fine with MkIV. I tried with the tikz version available on ConTeXt garden (pgf 3.0.1, pgfplots 1.16) and the last one from CTAN (pgf 3.1.7a, pgfplots 1.17) with the same result.

looks like \PackageError is undefined which is something PGF

but maybe you should

! Package pgfplots Warning: running in backwards compatibility mode 
(unsuitable tick labels; missing features). Consider writing 
\pgfplotsset{compat=1.17} into your preamble.

use that setting in order to not end up at that command

Hans


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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: LMTX and addplot table
       [not found]   ` <EB02BBB4-B1B6-45B9-BAA1-0729B3651B32@centralesupelec.fr>
@ 2020-12-12 12:20     ` Hans Hagen
  2020-12-12 12:28       ` Wolfgang Schuster
  2020-12-12 14:35       ` Jean-Philippe Rey
  0 siblings, 2 replies; 7+ messages in thread
From: Hans Hagen @ 2020-12-12 12:20 UTC (permalink / raw)
  To: Jean-Philippe Rey; +Cc: mailing list for ConTeXt users

On 12/12/2020 12:19 PM, Jean-Philippe Rey wrote:
> 
> 
>> Le 12 déc. 2020 à 11:58, Hans Hagen <j.hagen@xs4all.nl 
>> <mailto:j.hagen@xs4all.nl>> a écrit :
>>
>> On 12/12/2020 10:36 AM, Jean-Philippe Rey wrote:
>>> Dear list,
>>> I am unable to draw a plot using an external file with LMTX. Here is 
>>> a minimal example
>>> =====================
>>> \usemodule[pgfplots]
>>> \starttext
>>> \starttikzpicture
>>> \startaxis
>>> \addplot table [x=t, y=E] {mfe-addplot.dat};
>>> \stopaxis
>>> \stoptikzpicture
>>> \stoptext
>>> =====================
>>> The ConTeXt run fails with an "Undefined control sequence" error (see 
>>> attached log file). I don't know if this is an LMTX or PGF issue. The 
>>> example works fine with MkIV. I tried with the tikz version available 
>>> on ConTeXt garden (pgf 3.0.1, pgfplots 1.16) and the last one from 
>>> CTAN (pgf 3.1.7a, pgfplots 1.17) with the same result.
>>
>> looks like \PackageError is undefined which is something PGF
>>
>> but maybe you should
>>
>> ! Package pgfplots Warning: running in backwards compatibility mode 
>> (unsuitable tick labels; missing features). Consider writing 
>> \pgfplotsset{compat=1.17} into your preamble.
>>
>> use that setting in order to not end up at that command
> 
> Thanks Hans, but it doesn't seem to change anything.
I am not really a tikz user but can run it here

wipe t-tikz.* on your machine in order to use m-tikz.mkiv in the 
distribution because it looks like it does a bad catcode table change 
... that went unnoticed because a chardef'd constant gets typeset (and 
when that happens before \starttext you won't see it but it actually 
does introduce some funny char); in lmtx we don't use chardef for that 
so that can give an error then when loading

anyway, you're not suffering from that i think but better use the right 
module loader anyway

then you can define the \PackageError macro (I did it with some trial 
and error but the next seems to work:

\let\PackageError\writestatus

so I'll add something like that to m-tikz.mkiv

after all that I get this:

PGFPlots: reading {mfe-addplot.dat}

pgfplots        > Sorry, could not retrieve column 't' from table 
'\\pgfplotstableread@filename@@table@name '. Please check spelling (or 
introduce name aliases).
pgfplots        > Sorry, could not retrieve column 'E' from table 
'\\pgfplotstableread@filename@@table@name '. Please check spelling (or 
introduce name aliases).
pgfplots        > Sorry, the requested column number '' in table 
'mfe-addplot.dat' does not exist!? Please verify you used the correct 
index 0 <= i < N.
pgfplots        > Sorry, the requested column number '' in table 
'mfe-addplot.dat' does not exist!? Please verify you used the correct 
index 0 <= i < N.
NOTE: coordinate (,) has been dropped because of a coordinate filter. 
(see also unbounded coords=jump).

pgfplots        > Sorry, the requested column number '' in table 
'mfe-addplot.dat' does not exist!? Please verify you used the correct 
index 0 <= i < N.
pgfplots        > Sorry, the requested column number '' in table 
'mfe-addplot.dat' does not exist!? Please verify you used the correct 
index 0 <= i < N.
NOTE: coordinate (,) has been dropped because of a coordinate filter. 
(see also unbounded coords=jump).

pgfplots        > Sorry, the requested column number '' in table 
'mfe-addplot.dat' does not exist!? Please verify you used the correct 
index 0 <= i < N.
pgfplots        > Sorry, the requested column number '' in table 
'mfe-addplot.dat' does not exist!? Please verify you used the correct 
index 0 <= i < N.
NOTE: coordinate (,) has been dropped because of a coordinate filter. 
(see also unbounded coords=jump).

pgfplots        > Sorry, the requested column number '' in table 
'mfe-addplot.dat' does not exist!? Please verify you used the correct 
index 0 <= i < N.
pgfplots        > Sorry, the requested column number '' in table 
'mfe-addplot.dat' does not exist!? Please verify you used the correct 
index 0 <= i < N.
NOTE: coordinate (,) has been dropped because of a coordinate filter. 
(see also unbounded coords=jump).

! Package pgfplots Warning: the current plot has no coordinates (or all 
have been filtered away)

  [warning /pgfplots/warning/plot without coordinates]

! Package pgfplots Warning: You have an axis with empty range (in 
direction y). Replacing it with a default range and clearing all plots.

  [warning /pgfplots/warning/empty range cleared axis]

which still looks bad but at least you don't crash .. i'll look into 
that later today (as i'm splitting mkiv/lmtx code i use a slightly 
different file reader so maybe that's it)

Hans


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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: LMTX and addplot table
  2020-12-12 12:20     ` Hans Hagen
@ 2020-12-12 12:28       ` Wolfgang Schuster
  2020-12-12 14:35       ` Jean-Philippe Rey
  1 sibling, 0 replies; 7+ messages in thread
From: Wolfgang Schuster @ 2020-12-12 12:28 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Hans Hagen

Hans Hagen schrieb am 12.12.2020 um 13:20:
> On 12/12/2020 12:19 PM, Jean-Philippe Rey wrote:
>>> Le 12 déc. 2020 à 11:58, Hans Hagen <j.hagen@xs4all.nl 
>>> <mailto:j.hagen@xs4all.nl>> a écrit :
>>>
>>> On 12/12/2020 10:36 AM, Jean-Philippe Rey wrote:
>>>> Dear list,
>>>> I am unable to draw a plot using an external file with LMTX. Here 
>>>> is a minimal example
>>>> =====================
>>>> \usemodule[pgfplots]
>>>> \starttext
>>>> \starttikzpicture
>>>> \startaxis
>>>> \addplot table [x=t, y=E] {mfe-addplot.dat};
>>>> \stopaxis
>>>> \stoptikzpicture
>>>> \stoptext
>>>> =====================
>>>> The ConTeXt run fails with an "Undefined control sequence" error 
>>>> (see attached log file). I don't know if this is an LMTX or PGF 
>>>> issue. The example works fine with MkIV. I tried with the tikz 
>>>> version available on ConTeXt garden (pgf 3.0.1, pgfplots 1.16) and 
>>>> the last one from CTAN (pgf 3.1.7a, pgfplots 1.17) with the same 
>>>> result.
>>>
>>> looks like \PackageError is undefined which is something PGF

\PackageError is a LaTeX command which takes 3 argument: 
\PackageError{<package>}{<error>}{<help>}

Wolfgang

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: LMTX and addplot table
  2020-12-12 12:20     ` Hans Hagen
  2020-12-12 12:28       ` Wolfgang Schuster
@ 2020-12-12 14:35       ` Jean-Philippe Rey
  2020-12-12 16:01         ` Hans Hagen
  2020-12-12 16:03         ` Hans Hagen
  1 sibling, 2 replies; 7+ messages in thread
From: Jean-Philippe Rey @ 2020-12-12 14:35 UTC (permalink / raw)
  To: Hans Hagen; +Cc: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 3372 bytes --]



> Le 12 déc. 2020 à 13:20, Hans Hagen <j.hagen@xs4all.nl> a écrit :
> 
> On 12/12/2020 12:19 PM, Jean-Philippe Rey wrote:
>>> Le 12 déc. 2020 à 11:58, Hans Hagen <j.hagen@xs4all.nl <mailto:j.hagen@xs4all.nl>> a écrit :
>>> 
>>> On 12/12/2020 10:36 AM, Jean-Philippe Rey wrote:
>>>> Dear list,
>>>> I am unable to draw a plot using an external file with LMTX. Here is a minimal example
>>>> =====================
>>>> \usemodule[pgfplots]
>>>> \starttext
>>>> \starttikzpicture
>>>> \startaxis
>>>> \addplot table [x=t, y=E] {mfe-addplot.dat};
>>>> \stopaxis
>>>> \stoptikzpicture
>>>> \stoptext
>>>> =====================
>>>> The ConTeXt run fails with an "Undefined control sequence" error (see attached log file). I don't know if this is an LMTX or PGF issue. The example works fine with MkIV. I tried with the tikz version available on ConTeXt garden (pgf 3.0.1, pgfplots 1.16) and the last one from CTAN (pgf 3.1.7a, pgfplots 1.17) with the same result.
> 
> wipe t-tikz.* on your machine in order to use m-tikz.mkiv in the distribution because it looks like it does a bad catcode table change ... that went unnoticed because a chardef'd constant gets typeset (and when that happens before \starttext you won't see it but it actually does introduce some funny char); in lmtx we don't use chardef for that so that can give an error then when loading
> 
> anyway, you're not suffering from that i think but better use the right module loader anyway


I wiped t-tikz.  The only noticeable difference is that now I need to explicitly \usemodule[tikz] in order to use pgfplots. I checked and found the line

\usemodule[t][tikz]

in t-pgfplots.tex.  I guess that explains it.


> then you can define the \PackageError macro (I did it with some trial and error but the next seems to work:
> 
> \let\PackageError\writestatus
> 
> so I'll add something like that to m-tikz.mkiv

As Wolfgang pointed out, \PackageError takes three parameters, the third is meant to be displayed when the user types H to an error prompt. I defined it as

\def/PackageError#1#2#3{\writestatus{#1}{#2 (#3)}}

that effectively displays the error message in the console and the log file.


> which still looks bad but at least you don't crash .. i'll look into that later today (as i'm splitting mkiv/lmtx code i use a slightly different file reader so maybe that's it)

I guess that you've pinpointed the problem.

By default, pgfplotstable breaks lines at white space (tab or space according to the pgfplotstable manual). I used tabs as column separators in my demo file. With MKiV, the columns are correctly split but with LMTX, pgfplotstable sees a single column.

I explicitly stated that the columns are separated with tabs:

\addplot table [x=t, y=E, col sep=tab] {mfe-addplot.dat};

and it works. I tried to change the columns separator to a space, instead of a tab and it also works.

I don't know what pgfplotstable uses to split columns, but the conclusion is that with MkIV 'col sep=space' means space or tab, whereas with LMTX it means strictly a space character.

Thank you very much for your help.

-- 
Jean-Philippe Rey
jean-philippe.rey@centralesupelec.fr <mailto:jean-philippe.rey@centralesupelec.fr>
91192 Gif-sur-Yvette Cedex - France
Empreinte PGP : 807A 5B2C 69E4 D4B5 783A 428A 1B5E E83E 261B BF51


[-- Attachment #1.2: Type: text/html, Size: 7574 bytes --]

[-- Attachment #2: Type: text/plain, Size: 493 bytes --]

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: LMTX and addplot table
  2020-12-12 14:35       ` Jean-Philippe Rey
@ 2020-12-12 16:01         ` Hans Hagen
  2020-12-12 16:03         ` Hans Hagen
  1 sibling, 0 replies; 7+ messages in thread
From: Hans Hagen @ 2020-12-12 16:01 UTC (permalink / raw)
  To: Jean-Philippe Rey; +Cc: mailing list for ConTeXt users

On 12/12/2020 3:35 PM, Jean-Philippe Rey wrote:

> By default, pgfplotstable breaks lines at white space (tab or space 
> according to the pgfplotstable manual). I used tabs as column separators 
> in my demo file. With MKiV, the columns are correctly split but with 
> LMTX, pgfplotstable sees a single column.
> 
> I explicitly stated that the columns are separated with tabs:
> 
> \addplot table [x=t, y=E, col sep=tab] {mfe-addplot.dat};
> 
> and it works. I tried to change the columns separator to a space, 
> instead of a tab and it also works.
> 
> I don't know what pgfplotstable uses to split columns, but the 
> conclusion is that with MkIV 'col sep=space' means space or tab, whereas 
> with LMTX it means strictly a space character.
> 
> Thank you very much for your help.
I think I have it running now but you have to wait for an update (one of 
those curious border cases where tex bends a rule by turning tabs into 
spaces (the alternative is to let the tab token flagged as spacer travel 
around which would permits round trip). Makes me wonder I should have 
that as option in luametatex (but as I'm now in metapost mode I delay 
that pondering.)

Hans

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: LMTX and addplot table
  2020-12-12 14:35       ` Jean-Philippe Rey
  2020-12-12 16:01         ` Hans Hagen
@ 2020-12-12 16:03         ` Hans Hagen
  1 sibling, 0 replies; 7+ messages in thread
From: Hans Hagen @ 2020-12-12 16:03 UTC (permalink / raw)
  To: Jean-Philippe Rey; +Cc: mailing list for ConTeXt users

On 12/12/2020 3:35 PM, Jean-Philippe Rey wrote:

> I wiped t-tikz.  The only noticeable difference is that now I need to 
> explicitly \usemodule[tikz] in order to use pgfplots. I checked and 
> found the line
> 
> \usemodule[t][tikz]
> 
> in t-pgfplots.tex.  I guess that explains it.
probably ... anyway, when we enable more strong protection of macros in 
context one needs the mentioned variant anyway (that way I can deal with 
it .. there a few tikz files in the test suite so they would bark when 
something fails)

Hans


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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-12-12 16:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-12  9:36 LMTX and addplot table Jean-Philippe Rey
2020-12-12 10:58 ` Hans Hagen
     [not found]   ` <EB02BBB4-B1B6-45B9-BAA1-0729B3651B32@centralesupelec.fr>
2020-12-12 12:20     ` Hans Hagen
2020-12-12 12:28       ` Wolfgang Schuster
2020-12-12 14:35       ` Jean-Philippe Rey
2020-12-12 16:01         ` Hans Hagen
2020-12-12 16:03         ` Hans Hagen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).