PythonGraphics with data file

2014-06-11 Thread Wolfgang Engelmann
If one wants to use a figure in PythonGraphics which needs an external 
data set, how is this achieved?

Wolfgang


Re: PythonGraphics with data file

2014-06-11 Thread Rainer M Krug
Wolfgang Engelmann engelm...@uni-tuebingen.de writes:

 If one wants to use a figure in PythonGraphics which needs an external
 data set, how is this achieved?
 Wolfgang

What lyx does, if configured as described earlier, is simply

1) running the Python (or whatever language) script (saved in a file with
the extension pygr and e.g. the name MyScript.pygr) to generate a graphic of a 
given format (lets assume
eps) with the name MyScript.eps
2) converts the MyScript.eps to .png for preview
3) converts the MyScript.eps to the format required by the output format
(e.g. .pdf for pdflatex)

The question how to use external datasets to generate the graphic is a
pure Python question and has nothing to do with LyX: if the Python script is
executed from the command line and generates a MyScript.eps graphic it
should work in LyX as well.

Cheers,

Rainer


-- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :   +33 - (0)9 53 10 27 44
Cell:   +33 - (0)6 85 62 59 98
Fax :   +33 - (0)9 58 10 27 44

Fax (D):+49 - (0)3 21 21 25 22 44

email:  rai...@krugs.de

Skype:  RMkrug

PGP: 0x0F52F982


pgpqodTl49I3d.pgp
Description: PGP signature


Re: PythonGraphics with data file

2014-06-11 Thread Wolfgang Engelmann


Am 11.06.2014 10:30, schrieb Rainer M Krug:

Wolfgang Engelmann engelm...@uni-tuebingen.de writes:


If one wants to use a figure in PythonGraphics which needs an external
data set, how is this achieved?
Wolfgang

What lyx does, if configured as described earlier, is simply

1) running the Python (or whatever language) script (saved in a file with
the extension pygr and e.g. the name MyScript.pygr) to generate a graphic of a 
given format (lets assume
eps) with the name MyScript.eps
2) converts the MyScript.eps to .png for preview
3) converts the MyScript.eps to the format required by the output format
(e.g. .pdf for pdflatex)

The question how to use external datasets to generate the graphic is a
pure Python question and has nothing to do with LyX: if the Python script is
executed from the command line and generates a MyScript.eps graphic it
should work in LyX as well.

Cheers,

Rainer


Yes, Rainer,  I understand that. My question was -being not familiar 
with python- whether one can include the data set in the python script. 
I use pyxplot where this can be done by simply adding

--
and afterward the data set. The advantage is, that one does not need to 
keep an extra file outside the script.

Wolfgang


PythonGraphics with data file

2014-06-11 Thread Wolfgang Engelmann
If one wants to use a figure in PythonGraphics which needs an external 
data set, how is this achieved?

Wolfgang


Re: PythonGraphics with data file

2014-06-11 Thread Rainer M Krug
Wolfgang Engelmann engelm...@uni-tuebingen.de writes:

 If one wants to use a figure in PythonGraphics which needs an external
 data set, how is this achieved?
 Wolfgang

What lyx does, if configured as described earlier, is simply

1) running the Python (or whatever language) script (saved in a file with
the extension pygr and e.g. the name MyScript.pygr) to generate a graphic of a 
given format (lets assume
eps) with the name MyScript.eps
2) converts the MyScript.eps to .png for preview
3) converts the MyScript.eps to the format required by the output format
(e.g. .pdf for pdflatex)

The question how to use external datasets to generate the graphic is a
pure Python question and has nothing to do with LyX: if the Python script is
executed from the command line and generates a MyScript.eps graphic it
should work in LyX as well.

Cheers,

Rainer


-- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :   +33 - (0)9 53 10 27 44
Cell:   +33 - (0)6 85 62 59 98
Fax :   +33 - (0)9 58 10 27 44

Fax (D):+49 - (0)3 21 21 25 22 44

email:  rai...@krugs.de

Skype:  RMkrug

PGP: 0x0F52F982


pgpqodTl49I3d.pgp
Description: PGP signature


Re: PythonGraphics with data file

2014-06-11 Thread Wolfgang Engelmann


Am 11.06.2014 10:30, schrieb Rainer M Krug:

Wolfgang Engelmann engelm...@uni-tuebingen.de writes:


If one wants to use a figure in PythonGraphics which needs an external
data set, how is this achieved?
Wolfgang

What lyx does, if configured as described earlier, is simply

1) running the Python (or whatever language) script (saved in a file with
the extension pygr and e.g. the name MyScript.pygr) to generate a graphic of a 
given format (lets assume
eps) with the name MyScript.eps
2) converts the MyScript.eps to .png for preview
3) converts the MyScript.eps to the format required by the output format
(e.g. .pdf for pdflatex)

The question how to use external datasets to generate the graphic is a
pure Python question and has nothing to do with LyX: if the Python script is
executed from the command line and generates a MyScript.eps graphic it
should work in LyX as well.

Cheers,

Rainer


Yes, Rainer,  I understand that. My question was -being not familiar 
with python- whether one can include the data set in the python script. 
I use pyxplot where this can be done by simply adding

--
and afterward the data set. The advantage is, that one does not need to 
keep an extra file outside the script.

Wolfgang


PythonGraphics with data file

2014-06-11 Thread Wolfgang Engelmann
If one wants to use a figure in PythonGraphics which needs an external 
data set, how is this achieved?

Wolfgang


Re: PythonGraphics with data file

2014-06-11 Thread Rainer M Krug
Wolfgang Engelmann  writes:

> If one wants to use a figure in PythonGraphics which needs an external
> data set, how is this achieved?
> Wolfgang

What lyx does, if configured as described earlier, is simply

1) running the Python (or whatever language) script (saved in a file with
the extension pygr and e.g. the name MyScript.pygr) to generate a graphic of a 
given format (lets assume
eps) with the name MyScript.eps
2) converts the MyScript.eps to .png for preview
3) converts the MyScript.eps to the format required by the output format
(e.g. .pdf for pdflatex)

The question how to use external datasets to generate the graphic is a
pure Python question and has nothing to do with LyX: if the Python script is
executed from the command line and generates a MyScript.eps graphic it
should work in LyX as well.

Cheers,

Rainer


-- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, 
UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :   +33 - (0)9 53 10 27 44
Cell:   +33 - (0)6 85 62 59 98
Fax :   +33 - (0)9 58 10 27 44

Fax (D):+49 - (0)3 21 21 25 22 44

email:  rai...@krugs.de

Skype:  RMkrug

PGP: 0x0F52F982


pgpqodTl49I3d.pgp
Description: PGP signature


Re: PythonGraphics with data file

2014-06-11 Thread Wolfgang Engelmann


Am 11.06.2014 10:30, schrieb Rainer M Krug:

Wolfgang Engelmann  writes:


If one wants to use a figure in PythonGraphics which needs an external
data set, how is this achieved?
Wolfgang

What lyx does, if configured as described earlier, is simply

1) running the Python (or whatever language) script (saved in a file with
the extension pygr and e.g. the name MyScript.pygr) to generate a graphic of a 
given format (lets assume
eps) with the name MyScript.eps
2) converts the MyScript.eps to .png for preview
3) converts the MyScript.eps to the format required by the output format
(e.g. .pdf for pdflatex)

The question how to use external datasets to generate the graphic is a
pure Python question and has nothing to do with LyX: if the Python script is
executed from the command line and generates a MyScript.eps graphic it
should work in LyX as well.

Cheers,

Rainer


Yes, Rainer,  I understand that. My question was -being not familiar 
with python- whether one can include the data set in the python script. 
I use pyxplot where this can be done by simply adding

--
and afterward the data set. The advantage is, that one does not need to 
keep an extra file outside the script.

Wolfgang