Dear List, I have used TikZ and pgfplots for a few years and I am considering switching to metapost/metafun which appears more efficient with LMTX. I have already designed several figures with metapost/metafun and some with the help of metaobj and I am fully satisfied with the result. I am now trying to draw graphs with the metapost graph module, but I haven't been integrated to my ConTeXt LMTX document. The following example works perfectly well when compiled directly with metapost (from TeXlive 2020). ===== mpost example ============= beginfig(1) input graph draw begingraph(150mm, 100mm); gdraw "test-mpgraph.txt"; endgraph; endfig; end ================================= Here is my demo data file ==== test-mpgraph.txt ======== 0 0 1 1 2 2 3 1 4 3 5 2 6 1 ============================== I tried the following to draw directly from a ConTeXt document ==== LMTX example ================= \starttext \startMPcode troffmode:=0; prologues:=0; input graph draw begingraph(150mm, 100mm); gdraw "test-mpgraph.txt"; endgraph; \stopMPcode \stoptext =================================== I had to define troffmode and prologues, otherwise I get error messages about undecidable expressions and now I get an error that I don't understand (see attached log file). I also tried \usemodule[graph] as documented on the wiki (https://wiki.contextgarden.net/MPgraph) but without success. I guess I am doing something wrong. Could someone help me see my error? Thanks, -- 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
On 1/3/2021 7:12 PM, Jean-Philippe Rey wrote:
Dear List,
I have used TikZ and pgfplots for a few years and I am considering switching to metapost/metafun which appears more efficient with LMTX. I have already designed several figures with metapost/metafun and some with the help of metaobj and I am fully satisfied with the result.
Alan rewrote graph in a more context way ... so, there is the m-grapph.mkiv module (I admit, not tested for a while). 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 -----------------------------------------------------------------
Le 3 janv. 2021 à 19:21, Hans Hagen
a écrit : On 1/3/2021 7:12 PM, Jean-Philippe Rey wrote:
Dear List, I have used TikZ and pgfplots for a few years and I am considering switching to metapost/metafun which appears more efficient with LMTX. I have already designed several figures with metapost/metafun and some with the help of metaobj and I am fully satisfied with the result.
Alan rewrote graph in a more context way ... so, there is the m-grapph.mkiv module (I admit, not tested for a while).
Thank you Hans for pointing to this module. I took a look at m-graph.mkiv and wrote the following ====================================== \usemodule[graph] \starttext \startMPcode{graph} draw begingraph(150mm, 100mm); gdraw "test-mpgraph.txt"; endgraph; \stopMPcode \stoptext ====================================== which fails with "error: Improper type" (see attached log file). Maybe I don't understand how to use the graph module. -- 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
participants (2)
-
Hans Hagen
-
Jean-Philippe Rey