Discussion:
Python Graphics in LyX [was: Python bindings]
Alex Vergara Gil
2014-06-09 13:07:16 UTC
Permalink
Dear Lyxers!

Studying a little of python and LyX I have reached to this feature that makes LyX show and process python graphics. Thanks to Rainer M Krug for the hints. I share this contribution for LyX under LGPL license, so everyone benefits from it. Good luck and happy lyxing!

Alex Vergara Gil
MSc Nuclear Physics
SSDL, CPHR, Havana Cuba

PS: If Rainer agree, pass him from acknowledgements to author list, please.
Kornel Benko
2014-06-09 13:40:48 UTC
Permalink
Post by Alex Vergara Gil
Dear Lyxers!
Studying a little of python and LyX I have reached to this feature that makes LyX show and process python graphics. Thanks to Rainer M Krug for the hints. I share this contribution for LyX under LGPL license, so everyone benefits from it. Good luck and happy lyxing!
Alex Vergara Gil
MSc Nuclear Physics
SSDL, CPHR, Havana Cuba
PS: If Rainer agree, pass him from acknowledgements to author list, please.
Trying
# python example.pygr x.eps

I saw, I had to install matplotlib and pandas. Thats OK, this example shows now in lyx too.
Fortunately it was included in debian package manager.

But the try
# python example2.pygr x.eps
leads to
ImportError: No module named seaborn

After installing also python-pip and using
# sudo pip install seaborn

I got the expected output.

This should be documented somewhere I think.

Nice work.

Kornel
Alex Vergara Gil
2014-06-09 14:40:34 UTC
Permalink
----- Original Message ----- From: "Kornel Benko" Sent: Monday, June 09, 2014 8:40 AM
Post by Alex Vergara Gil
Dear Lyxers!
Studying a little of python and LyX I have reached to this feature that makes LyX show and process python graphics. Thanks to Rainer M Krug for the hints. I share this contribution for LyX under LGPL license, so everyone benefits from it. Good luck and happy lyxing!
Alex Vergara Gil
MSc Nuclear Physics
SSDL, CPHR, Havana Cuba
PS: If Rainer agree, pass him from acknowledgements to author list, please.
Trying
# python example.pygr x.eps
I saw, I had to install matplotlib and pandas. Thats OK, this example shows now in lyx too.
Fortunately it was included in debian package manager.
Indeed, to obtain python graphics matplotlib is required, pandas is a robust library to handle with complex data. Both are in any package manager. The fact that this displays in lyx too is a very nice extra. My first intention was to have a module that insert python code and executes it, but this way is far simpler and reaches the same objective.
But the try
# python example2.pygr x.eps
leads to
ImportError: No module named seaborn
After installing also python-pip and using
# sudo pip install seaborn
I got the expected output.
This should be documented somewhere I think.
Nice work.
Kornel
In this case my intention was to show that any other python library can be used as well, and it is expected a little knowledge of python from the user, since it is the user itself who will build its own graphic script. But your hint is valid, it should be documented how to obtain extra python packages too.

Regards
Alex
Rainer M Krug
2014-06-10 08:11:23 UTC
Permalink
Post by Alex Vergara Gil
Dear Lyxers!
Studying a little of python and LyX I have reached to this feature
that makes LyX show and process python graphics. Thanks to Rainer M
Krug for the hints. I share this contribution for LyX under LGPL
license, so everyone benefits from it. Good luck and happy lyxing!
Alex Vergara Gil
MSc Nuclear Physics
SSDL, CPHR, Havana Cuba
PS: If Rainer agree, pass him from acknowledgements to author list, please.
That looks beautiful. AS I have no idea how python works, co-author
would probably better.

Thanks,

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: ***@krugs.de

Skype: RMkrug

PGP: 0x0F52F982
Loading...