On 12/12/2020 12:19 PM, Jean-Philippe Rey wrote:
Le 12 déc. 2020 à 11:58, Hans Hagen
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 -----------------------------------------------------------------