[NTG-context] tikz pgfplots library problem

Aditya Mahajan adityam at umich.edu
Tue Jan 15 21:23:24 CET 2019


On Tue, 15 Jan 2019, Susanne G. Loeber wrote:

> Dear Reader,
>
> I am creating an image using TikZ PGFplots. When I add
> \usetikzlibrary[datavisualization] I get an error.
>
> A simple example to illustrate my problem:
>
> \usemodule[pgfplots]
> \usemodule[tikz]
>
> \usetikzlibrary[datavisualization]
>
> \starttext
>
> \starttikzpicture
> \draw (0,0) rectangle (1,2);
> \stoptikzpicture
>
> \stoptext
>
> What can be done? I am using TEXshop (4.22) on a Mac.
>
> ! Missing number, treated as zero
>
>
> <to be read again>
>
> ^
>
> l.682 {\catcode`\^^
>
> M=\active%

This particular error can be fixed using

\unprotect
\usetikzlibrary[datavisualization]
\protect

but then you get another error:

tex error       > tex error on line 2410 in file 
/opt/context-minimals/texmf-modules/tex/generic/pgf/frontendlayer/tikz/libraries/datavisualization/tikzlibrarydatavisualization.code.tex: 
! Undefined control sequence


\tikzdvdeclarestylesheetcolorseries ...olorseries

{tikzdvcolorseries#1}{#2}{...
l.2410 ...eries{vary hue}{hsb}{.4,0.9,0.8}{.213,0,0}


2400       \resetcolorseries{tikzdvcolorseries#1}
2401       \pgfdvdeclarestylesheet{#1}
2402       {
2403         default style/.style={
2404 
/utils/exec=\colorlet{tikz at dv@temp}[rgb]{tikzdvcolorseries#1!![##1]},
2405           visualizer color=tikz at dv@temp
2406         }
2407       }
2408     }
2409
2410 >>  \tikzdvdeclarestylesheetcolorseries{vary 
hue}{hsb}{.4,0.9,0.8}{.213,0,0}
2411     \tikzdvdeclarestylesheetcolorseries{shades of 
blue}{hsb}{.65,1.4,1}{0,-.4,-.0}
2412     \tikzdvdeclarestylesheetcolorseries{shades of 
red}{hsb}{0,1.4,1}{0,-.4,-.0}
2413     \tikzdvdeclarestylesheetcolorseries{gray 
scale}{hsb}{0,0,-.34}{0,0,.34}
2414
2415
2416

which you can "fix" by adding:

\def\definecolorseries{\gobblefourarguments}
\def\resetcolorseries{\gobbleoneargument}

So, at least, the following compiles:

\usemodule[pgfplots]
\usemodule[tikz]

\def\definecolorseries{\gobblefourarguments}
\def\resetcolorseries{\gobbleoneargument}
\unprotect
\usetikzlibrary[datavisualization]
\protect

\starttext

\starttikzpicture
\draw (0,0) rectangle (1,2);
\stoptikzpicture

\stoptext


Aditya


More information about the ntg-context mailing list