From: Jaroslav Hajtmar <hajtmar@gyza.cz>
To: DesdeChaves <desdechaves@gmail.com>
Cc: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Pgfplots - passing point coordinates by Lua
Date: Mon, 17 Feb 2014 01:11:44 +0100 [thread overview]
Message-ID: <530153C0.30405@gyza.cz> (raw)
In-Reply-To: <CAPBmU9FPSk65u2P58vZ300WbRM6KQpmn89+uuzMd1po94BQmnA@mail.gmail.com>
Thanks Jorge
for the helpful and useful instructions. Sometimes it will certainly
come in handy.
Jaroslav Hajtmar
Dne 17.2.2014 0:53, DesdeChaves napsal(a):
> \usemodule[tikz]
> \usemodule[pgfplots]
> \usemodule[pgfplotstable]
>
> \starttext
>
> \startluacode
>
> local dados={};
>
> for i=1,10 do
> dados[i]=2*i
> end
>
> context("\\starttikzpicture")
> context("\\pgfplotsset{width=10cm, compat=1.3, legend
> style={font=\\tfx}}")
> context("\\startaxis[")
> context("xlabel={L (m) },")
> context("ylabel={ $T^2 (s^2)$},legend cell align=left, legend
> pos=north west]")
> context("\\addplot[only marks] table[row sep=\\\\]{")
> context("X Y\\\\")
> for key,value in pairs(dados) do
> context("%0.2f %0.1f \\\\", key, value)
> end
> context(" };")
> context("\\addlegendentry{Experimental points}")
> context("\\addplot table[row sep=\\\\,")
> context("y={create col/linear regression={y=Y}}]{")
> context("X Y\\\\")
> for key,value in pairs(dados) do
> context("%0.2f %0.1f \\\\", key, value)
> end
> context("};")
> context("\\addlegendentry{")
> context("$\\pgfmathprintnumber{\\pgfplotstableregressiona} \\cdot x")
> context("\\pgfmathprintnumber[print
> sign]{\\pgfplotstableregressionb}$ lin. Regression}")
> context("\\stopaxis")
> context("\\stoptikzpicture")
>
> \stopluacode
>
>
> \stoptext
___________________________________________________________________________________
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://tex.aanhet.net
archive : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
prev parent reply other threads:[~2014-02-17 0:11 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-15 19:38 Lukáš Procházka
2014-02-16 19:32 ` Herbert Voss
2014-02-16 20:39 ` Lukáš Procházka
2014-02-16 21:56 ` Herbert Voss
2014-02-16 23:00 ` Jaroslav Hajtmar
2014-02-16 23:53 ` DesdeChaves
2014-02-17 0:11 ` Jaroslav Hajtmar [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=530153C0.30405@gyza.cz \
--to=hajtmar@gyza.cz \
--cc=desdechaves@gmail.com \
--cc=ntg-context@ntg.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).