4

I tried to use pgfplots groupplots library in ConTeXt. Therefore I loaded pgfplots and the library as described in the manual. It seems to load correctly when looking at the log file. Normal use of pgfplots does work too.

The environment \startgroupplot/\stopgroupplot is unknown, do I miss something?

I tried to get the example from the manual running.

\usemodule[tikz]
\usemodule[pgfplots]
\usepgfplotslibrary[groupplots]
\pgfplotsset{
    compat=newest,
}

\starttext

    \starttikzpicture
        \startgroupplot[group style={group size = 2 by 2}, height=3cm, width=3cm]
            \nextgroupplot
            \addplot coordinates {(0,0) (1,1) (2,2)};
            \nextgroupplot
            \addplot coordinates {(0,2) (1,1) (2,0)};
            \nextgroupplot
            \addplot coordinates {(0,2) (1,1) (2,1)};
            \nextgroupplot
            \addplot coordinates {(0,2) (1,1) (1,0)};
        \stopgroupplot
    \stoptikzpicture

\stoptext
  • 2
    It is \groupplot ... \endgroupplot. Unfortunately, this library does not define ConTeXt synonyms. – Henri Menke Jun 21 '17 at 19:39
6

It is \groupplot ... \endgroupplot. Unfortunately, this library does not define ConTeXt synonyms, but to get the ConTeXt-y feeling you can easily define them yourself.

\usemodule[tikz]
\usemodule[pgfplots]
\usepgfplotslibrary[groupplots]
\pgfplotsset{
    compat=newest,
}

\unexpanded\def\startgroupplot{\groupplot}
\unexpanded\def\stopgroupplot{\endgroupplot}

\starttext

    \starttikzpicture
        \startgroupplot[group style={group size = 2 by 2}, height=3cm, width=3cm]
            \nextgroupplot
            \addplot coordinates {(0,0) (1,1) (2,2)};
            \nextgroupplot
            \addplot coordinates {(0,2) (1,1) (2,0)};
            \nextgroupplot
            \addplot coordinates {(0,2) (1,1) (2,1)};
            \nextgroupplot
            \addplot coordinates {(0,2) (1,1) (1,0)};
        \stopgroupplot
    \stoptikzpicture

\stoptext

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.