Re: Python Graphics in LyX [was: Python bindings]

2014-06-19 Thread Stephan Witt
Am 19.06.2014 um 19:02 schrieb "Alex Vergara Gil" :

> - Original Message - From: "Wolfgang Keller"  Sent: 
> Thursday, June 19, 2014 9:23 AM
>> I couldn't open your attachment with 7zip on Windows.
>> 
>> Sincerely,
>> 
>> Wolfgang
>> 
> 
> That's odd, look my test in virtual win XP
> 
> Alex 
> <7zip.JPG>


I can decode the contents on Unix too.

$ xz -d -c /Users/stephan/Downloads/Software/Python\ Graphics.tar.xz | tar tf -
3D_map.pygr
contour_map.pygr
csv.pygr
dicom_show.pygr
errorbar_demo.pygr
errorbar_demo_features.pygr
example.pygr
example2.pygr
GE_COLOR_2.lut
histogram_demo_features.pygr
pc iart CT200.dcm
Python Graphics.lyx
Python Graphics.pdf
tips.csv
$ 

Stephan

Re: Python Graphics in LyX [was: Python bindings]

2014-06-19 Thread Wolfgang Keller
> Yeah! And to prove this statement I've attached some examples.

I couldn't open your attachment with 7zip on Windows.

Sincerely,

Wolfgang


Re: Python Graphics in LyX [was: Python bindings]

2014-06-13 Thread Ross Reyes


On 6/12/2014 5:10 PM, Alex Vergara Gil wrote:
- Original Message - From: "Ross Reyes"  
Sent: Thursday, June 12, 2014 12:50 PM


On 6/11/2014 12:41 PM, Rainer M Krug wrote:


Envoyé de mon iPhone


Le 11 juin 2014 à 16:07, Ross Reyes  a écrit :


Hi Alex,

I still get the "error converting to loadable format" message.

I can run the python script from the command line and it does 
work.   I can
and have modified the .pygr script to produce other outputs in 
.png, .jpg, .ps, etc.

without problem.


If the scripts work fine outside LyX then your problem is with your 
LyX instalation. The only thing I can suggest is to update at least to 
version 2.0.3 which is the one I have tested in my debian system.




But inside LyX, regardless of what I do to define the converter,  I 
can not get the image

to render nor can I produce a .pdf output from the LyX doc.

Something is not right.   I am using LyX 2.0.1
The converters are defined in the configuration file LyX. If you 
could take a loom at it and post the lines where you file formats 
and the converters are defined, one could see if there is something 
wrong. I don't have LyX at hand, so I can't give you the location of 
the config file.


Cheers,

Rainer

Hi Rainer,   I have this in my preferences file for pygr fomat and 
converter.


#
# FORMATS SECTION ##
#

\format "pdf4" "pdf" "PDF (xelatex)" "" "" "" 
"document,vector,menu=export"

\format "pygr" "pygr" "Python Graphics" "" "auto" "auto" "vector"
\default_view_format ps

#
# CONVERTERS SECTION ##
#

\converter "pdflatex" "pdf4" "xelatex $$i" "latex=pdflatex"
\converter "eps" "png" "epstopng.bat $$i" ""
\converter "pygr" "png" "python $$i $$o" ""



All of this seems ok, take into account that if you are on Windows the 
correct converter line should be

\converter "pygr" "png" "python -tt $$i $$o" ""

but it would be better if you to have
\converter "pygr" "eps" "python $$i $$o" "" on Linux
\converter "pygr" "eps" "python -tt $$i $$o" "" on Windows


Thank you for your inputs.

The problem is that I'm using LyTeX 2.0.1 and it comes bundled with its 
own Python.   The Python that is in the

directory did not contain the python modules this needs.

I copied my version on my C: drive to the USB drive where LyTeX is and 
now everything is working well.


Thanks.


Re: Python Graphics in LyX [was: Python bindings]

2014-06-13 Thread Wolfgang Keller
> That looks beautiful. AS I have no idea how python works, co-author
> would probably better.

Python is the best scripting (and general purpose programming) language
ever invented. Not only for scientists. 

If you're using a computer intensively to earn your living, you *should*
learn it. Otherwise you're missing *something*, in terms of
productivity you can achieve.

Sincerely,

Wolfgang


Re: Python Graphics in LyX [was: Python bindings]

2014-06-12 Thread Alex Vergara Gil
- Original Message - From: "Ross Reyes"  Sent: 
Thursday, June 12, 2014 12:50 PM


On 6/11/2014 12:41 PM, Rainer M Krug wrote:


Envoyé de mon iPhone


Le 11 juin 2014 à 16:07, Ross Reyes  a écrit :


Hi Alex,

I still get the "error converting to loadable format" message.

I can run the python script from the command line and it does work.   I 
can
and have modified the .pygr script to produce other outputs in .png, 
.jpg, .ps, etc.

without problem.


If the scripts work fine outside LyX then your problem is with your LyX 
instalation. The only thing I can suggest is to update at least to version 
2.0.3 which is the one I have tested in my debian system.




But inside LyX, regardless of what I do to define the converter,  I can 
not get the image

to render nor can I produce a .pdf output from the LyX doc.

Something is not right.   I am using LyX 2.0.1
The converters are defined in the configuration file LyX. If you could 
take a loom at it and post the lines where you file formats and the 
converters are defined, one could see if there is something wrong. I 
don't have LyX at hand, so I can't give you the location of the config 
file.


Cheers,

Rainer

Hi Rainer,   I have this in my preferences file for pygr fomat and 
converter.


#
# FORMATS SECTION ##
#

\format "pdf4" "pdf" "PDF (xelatex)" "" "" "" 
"document,vector,menu=export"

\format "pygr" "pygr" "Python Graphics" "" "auto" "auto" "vector"
\default_view_format ps

#
# CONVERTERS SECTION ##
#

\converter "pdflatex" "pdf4" "xelatex $$i" "latex=pdflatex"
\converter "eps" "png" "epstopng.bat $$i" ""
\converter "pygr" "png" "python $$i $$o" ""



All of this seems ok, take into account that if you are on Windows the 
correct converter line should be

\converter "pygr" "png" "python -tt $$i $$o" ""

but it would be better if you to have
\converter "pygr" "eps" "python $$i $$o" "" on Linux
\converter "pygr" "eps" "python -tt $$i $$o" "" on Windows 



Re: Python Graphics in LyX [was: Python bindings]

2014-06-12 Thread Ross Reyes


On 6/11/2014 12:41 PM, Rainer M Krug wrote:


Envoyé de mon iPhone


Le 11 juin 2014 à 16:07, Ross Reyes  a écrit :


Hi Alex,

I still get the "error converting to loadable format" message.

I can run the python script from the command line and it does work.   I can
and have modified the .pygr script to produce other outputs in .png, .jpg, .ps, 
etc.
without problem.

But inside LyX, regardless of what I do to define the converter,  I can not get 
the image
to render nor can I produce a .pdf output from the LyX doc.

Something is not right.   I am using LyX 2.0.1

The converters are defined in the configuration file LyX. If you could take a 
loom at it and post the lines where you file formats and the converters are 
defined, one could see if there is something wrong. I don't have LyX at hand, 
so I can't give you the location of the config file.

Cheers,

Rainer

Hi Rainer,   I have this in my preferences file for pygr fomat and 
converter.


#
# FORMATS SECTION ##
#

\format "pdf4" "pdf" "PDF (xelatex)" "" "" "" "document,vector,menu=export"
\format "pygr" "pygr" "Python Graphics" "" "auto" "auto" "vector"
\default_view_format ps

#
# CONVERTERS SECTION ##
#

\converter "pdflatex" "pdf4" "xelatex $$i" "latex=pdflatex"
\converter "eps" "png" "epstopng.bat $$i" ""
\converter "pygr" "png" "python $$i $$o" ""





Re: Python Graphics in LyX [was: Python bindings]

2014-06-11 Thread Rainer M Krug


Envoyé de mon iPhone

> Le 11 juin 2014 à 16:07, Ross Reyes  a écrit :
> 
> 
> Hi Alex,
> 
> I still get the "error converting to loadable format" message.
> 
> I can run the python script from the command line and it does work.   I can
> and have modified the .pygr script to produce other outputs in .png, .jpg, 
> .ps, etc.
> without problem.
> 
> But inside LyX, regardless of what I do to define the converter,  I can not 
> get the image
> to render nor can I produce a .pdf output from the LyX doc.
> 
> Something is not right.   I am using LyX 2.0.1

The converters are defined in the configuration file LyX. If you could take a 
loom at it and post the lines where you file formats and the converters are 
defined, one could see if there is something wrong. I don't have LyX at hand, 
so I can't give you the location of the config file. 

Cheers,

Rainer

> 
> Phil


Re: Python Graphics in LyX [was: Python bindings]

2014-06-11 Thread Ross Reyes


Hi Alex,

I still get the "error converting to loadable format" message.

I can run the python script from the command line and it does work.   I can
and have modified the .pygr script to produce other outputs in .png, 
.jpg, .ps, etc.

without problem.

But inside LyX, regardless of what I do to define the converter,  I can 
not get the image

to render nor can I produce a .pdf output from the LyX doc.

Something is not right.   I am using LyX 2.0.1

Phil


Re: Python Graphics in LyX [was: Python bindings]

2014-06-11 Thread Wolfgang Engelmann


Am 11.06.2014 09:53, schrieb Wolfgang Engelmann:


Am 11.06.2014 09:47, schrieb Wolfgang Engelmann:


Am 10.06.2014 22:26, schrieb Alex Vergara Gil:
- Original Message - From: Wolfgang Engelmann Sent: Tuesday, 
June 10, 2014 2:19 PM


Thanks, Alex, for the new lyx file. I now realized, that I had to 
load the matplotlib and pandas packages, which I did. I followed 
your advices
Define a new file format in tools>preferences, name it Python 
graphics, extension pygr and vector image format ticked
Define a new converter from the format Python graphics to the format 
EPS as ...
After reconfigure (necessary?) and making sure the two example 
graphics (in pygr format) are found in the path I get this error

No, reconfigure is not necessary
LaTeX Warning: File `0_home_we_Lyx_PhytonGraphics_example.eps' not 
found on input line 83.

Why is it expecting an eps file instead of taking the pygr files?
indeed a eps file is expected
What am I missing?
Wolfgang
Did you can see the graphic within LyX? Did LyX display it correctly 
in your system? if not the case check that the example script is 
located at the same path than the lyx file, another way is to click 
in the inserted graphic and look for the example.pygr path


Yes, all this is ok. However, both graphics (example.pygr, 
example2.pygr) show: Error converting to loadable format.





Another possible explanation is that your system doesn't handle with 
eps, in this case you should change the definition and instead of 
eps, put pdf or png as final format, whichever work for you, you can 
check that because it will display the graphic within LyX even 
before you export anything!


I have changed to png, now the first example renders alright (in 
LyX), but the second one not. Shouldn't your LyX file contain already 
your tools>preferences settings? Or how can one make LyX remember 
these settings, so that people trying it have not to fiddle with it?

Wolfgang

Sorry, I should have read the last part: Using more advanced python 
libraries are also allowed, like this example using seaborn, scipy 
and numpy. To obtain extra python packages you have to install the 
python-pip package manager and perform“pip install package” with root 
permissions, where package can be seaborn for instance. So I will try 
installing this and hope it will work. An additional question I will 
mail separately. Wolfgang



I can' find seaborn for python in synaptic (Kubuntu). Quoting: where 
package can be seaborn for instance.

What  other instances are available?
Wolfgang


Re: Python Graphics in LyX [was: Python bindings]

2014-06-11 Thread Wolfgang Engelmann


Am 11.06.2014 09:47, schrieb Wolfgang Engelmann:


Am 10.06.2014 22:26, schrieb Alex Vergara Gil:
- Original Message - From: Wolfgang Engelmann Sent: Tuesday, 
June 10, 2014 2:19 PM


Thanks, Alex, for the new lyx file. I now realized, that I had to 
load the matplotlib and pandas packages, which I did. I followed your 
advices
Define a new file format in tools>preferences, name it Python 
graphics, extension pygr and vector image format ticked
Define a new converter from the format Python graphics to the format 
EPS as ...
After reconfigure (necessary?) and making sure the two example 
graphics (in pygr format) are found in the path I get this error

No, reconfigure is not necessary
LaTeX Warning: File `0_home_we_Lyx_PhytonGraphics_example.eps' not 
found on input line 83.

Why is it expecting an eps file instead of taking the pygr files?
indeed a eps file is expected
What am I missing?
Wolfgang
Did you can see the graphic within LyX? Did LyX display it correctly 
in your system? if not the case check that the example script is 
located at the same path than the lyx file, another way is to click 
in the inserted graphic and look for the example.pygr path


Yes, all this is ok. However, both graphics (example.pygr, 
example2.pygr) show: Error converting to loadable format.





Another possible explanation is that your system doesn't handle with 
eps, in this case you should change the definition and instead of 
eps, put pdf or png as final format, whichever work for you, you can 
check that because it will display the graphic within LyX even before 
you export anything!


I have changed to png, now the first example renders alright (in LyX), 
but the second one not. Shouldn't your LyX file contain already your 
tools>preferences settings? Or how can one make LyX remember these 
settings, so that people trying it have not to fiddle with it?

Wolfgang

Sorry, I should have read the last part: Using more advanced python 
libraries are also allowed, like this example using seaborn, scipy and 
numpy. To obtain extra python packages you have to install the 
python-pip package manager and perform“pip install package” with root 
permissions, where package can be seaborn for instance. So I will try 
installing this and hope it will work. An additional question I will 
mail separately. Wolfgang





Re: Python Graphics in LyX [was: Python bindings]

2014-06-11 Thread Wolfgang Engelmann


Am 10.06.2014 22:26, schrieb Alex Vergara Gil:

   - Original Message - From: Wolfgang Engelmann Sent: Tuesday, June 
10, 2014 2:19 PM

   Thanks, Alex, for the new lyx file. I now realized, that I had to load the 
matplotlib and pandas packages, which I did. I followed your advices
   Define a new file format in tools>preferences, name it Python graphics, 
extension pygr and vector image format ticked
   Define a new converter from the format Python graphics to the format EPS as 
...
   After reconfigure (necessary?) and making sure the two example graphics (in 
pygr format) are found in the path I get this error
No, reconfigure is not necessary
   LaTeX Warning: File `0_home_we_Lyx_PhytonGraphics_example.eps' not found on 
input line 83.
   Why is it expecting an eps file instead of taking the pygr files?
indeed a eps file is expected
   What am I missing?
   Wolfgang
Did you can see the graphic within LyX? Did LyX display it correctly in your 
system? if not the case check that the example script is located at the same 
path than the lyx file, another way is to click in the inserted graphic and 
look for the example.pygr path


Yes, all this is ok. However, both graphics (example.pygr, example2.pygr) show: 
Error converting to loadable format.




Another possible explanation is that your system doesn't handle with eps, in 
this case you should change the definition and instead of eps, put pdf or png 
as final format, whichever work for you, you can check that because it will 
display the graphic within LyX even before you export anything!


I have changed to png, now the first example renders alright (in LyX), but the 
second one not. Shouldn't your LyX file contain already your tools>preferences 
settings? Or how can one make LyX remember these settings, so that people trying 
it have not to fiddle with it?
Wolfgang




Re: Python Graphics in LyX [was: Python bindings]

2014-06-10 Thread Alex Vergara Gil
  - Original Message - From: Wolfgang Engelmann Sent: Tuesday, June 10, 
2014 2:19 PM

  Thanks, Alex, for the new lyx file. I now realized, that I had to load the 
matplotlib and pandas packages, which I did. I followed your advices 
  Define a new file format in tools>preferences, name it Python graphics, 
extension pygr and vector image format ticked
  Define a new converter from the format Python graphics to the format EPS as 
...
  After reconfigure (necessary?) and making sure the two example graphics (in 
pygr format) are found in the path I get this error
No, reconfigure is not necessary
  LaTeX Warning: File `0_home_we_Lyx_PhytonGraphics_example.eps' not found on 
input line 83.
  Why is it expecting an eps file instead of taking the pygr files?
indeed a eps file is expected
  What am I missing?
  Wolfgang
Did you can see the graphic within LyX? Did LyX display it correctly in your 
system? if not the case check that the example script is located at the same 
path than the lyx file, another way is to click in the inserted graphic and 
look for the example.pygr path

Another possible explanation is that your system doesn't handle with eps, in 
this case you should change the definition and instead of eps, put pdf or png 
as final format, whichever work for you, you can check that because it will 
display the graphic within LyX even before you export anything!

Regards
Alex

Re: Python Graphics in LyX [was: Python bindings]

2014-06-10 Thread Wolfgang Engelmann


Am 10.06.2014 15:52, schrieb Alex Vergara Gil:
Thanks, Alex, for the new lyx file. I now realized, that I had to load 
the matplotlib and pandas packages, which I did. I followed your advices
Define a new file format in tools>preferences, name it Python graphics, 
extension pygr and vector image format ticked
Define a new converter from the format Python graphics to the format EPS 
as ...
After reconfigure (necessary?) and making sure the two example graphics 
(in pygr format) are found in the path I get this error


LaTeX Warning: File `0_home_we_Lyx_PhytonGraphics_example.eps' not found 
on input line 83.


Why is it expecting an eps file instead of taking the pygr files?
What am I missing?
Wolfgang


Dear all

I have rewritten a little the procedure using recommendations from several 
users that doesn´t understand the original one. I hope this time everyone can 
understand the procedure.

Regards
Alex
   - Original Message -
   From: Wolfgang Engelmann
   To: lyx-users@lists.lyx.org
   Sent: Tuesday, June 10, 2014 2:56 AM
   Subject: Re: Python Graphics in LyX [was: Python bindings]


   I retryed again and now got the PythonGraphics>LyX converter after 
reconfiguring, but running it gives me:


   LaTeX Warning: File `0_home_we_Lyx_PhytonGraphics_example.pdf' not found on 
inp

   ut line 80.
   shouldn't it load example.pygr, which I selected in my folder PhytonGraphics 
containing all the files supplied by Alex?
   Do I have to use instead of view>pdflatex something else for export?
   Wolfgang








   ! Package pdftex.def Error: File `0_home_we_Lyx_PhytonGraphics_example.pdf' 
not

   found.




   See the pdftex.def package documentation for explanation.

   Type H  for immediate help.

   ...

   Am 10.06.2014 09:00, schrieb Wolfgang Engelmann:


 Am 09.06.2014 21:42, schrieb Alex Vergara Gil:

  - Original Message -
  From: Wolfgang Engelmann
  To: lyx-users@lists.lyx.org
  Sent: Monday, June 09, 2014 12:55 PM
  Subject: Re: Python Graphics in LyX [was: Python bindings]


  where in lyx is this done?-->
  Define a new converter from Python graphics to EPS as

  python $$i $$o

  Wolfgang


   If you have followed the little manual you know in tools - preferences 
there is two options, one that says file types and the other says converters
   in the first you define the Python graphics file type
   in the second you define the converter

   regards
   Alex



   Thanks Alex, still not there.



   First: Could one change in the instruction of the PythonGraphics.lyx
   Define a new file format, name it Python graphics, extension pygr and 
vector image format ticked
   to: Define a new file format in tools>preferences, name it Python 
graphics, extension pygr and vector image format ticked



   Second: in Converters - Converter Definitions I guess I have to add 
python $$i $$o in the Converter: line. However, Add on the right side of the 
Converter Definitions is greyed out. So, how do I do that?



   Wolfgang






   __ Información de ESET NOD32 Antivirus, versión de la base de firmas 
de virus 9900 (20140605) __

   ESET NOD32 Antivirus ha comprobado este mensaje.

   http://www.eset.com





Re: Python Graphics in LyX [was: Python bindings]

2014-06-10 Thread Alex Vergara Gil
Dear all

I have rewritten a little the procedure using recommendations from several 
users that doesn´t understand the original one. I hope this time everyone can 
understand the procedure.

Regards
Alex
  - Original Message - 
  From: Wolfgang Engelmann 
  To: lyx-users@lists.lyx.org 
  Sent: Tuesday, June 10, 2014 2:56 AM
  Subject: Re: Python Graphics in LyX [was: Python bindings]


  I retryed again and now got the PythonGraphics>LyX converter after 
reconfiguring, but running it gives me:


  LaTeX Warning: File `0_home_we_Lyx_PhytonGraphics_example.pdf' not found on 
inp

  ut line 80.
  shouldn't it load example.pygr, which I selected in my folder PhytonGraphics 
containing all the files supplied by Alex?
  Do I have to use instead of view>pdflatex something else for export?
  Wolfgang








  ! Package pdftex.def Error: File `0_home_we_Lyx_PhytonGraphics_example.pdf' 
not

  found.




  See the pdftex.def package documentation for explanation.

  Type H  for immediate help.

  ... 

  Am 10.06.2014 09:00, schrieb Wolfgang Engelmann:


Am 09.06.2014 21:42, schrieb Alex Vergara Gil: 

 - Original Message - 
 From: Wolfgang Engelmann 
 To: lyx-users@lists.lyx.org 
 Sent: Monday, June 09, 2014 12:55 PM 
     Subject: Re: Python Graphics in LyX [was: Python bindings] 


 where in lyx is this done?--> 
 Define a new converter from Python graphics to EPS as 

 python $$i $$o 

 Wolfgang 


  If you have followed the little manual you know in tools - preferences 
there is two options, one that says file types and the other says converters 
  in the first you define the Python graphics file type 
  in the second you define the converter 

  regards 
  Alex 



  Thanks Alex, still not there. 



  First: Could one change in the instruction of the PythonGraphics.lyx 
  Define a new file format, name it Python graphics, extension pygr and 
vector image format ticked 
  to: Define a new file format in tools>preferences, name it Python 
graphics, extension pygr and vector image format ticked 



  Second: in Converters - Converter Definitions I guess I have to add 
python $$i $$o in the Converter: line. However, Add on the right side of the 
Converter Definitions is greyed out. So, how do I do that? 



  Wolfgang 






  __ Información de ESET NOD32 Antivirus, versión de la base de firmas 
de virus 9900 (20140605) __

  ESET NOD32 Antivirus ha comprobado este mensaje.

  http://www.eset.com


Python Graphics.lyx
Description: Binary data


Re: Python Graphics in LyX [was: Python bindings]

2014-06-10 Thread Rainer M Krug
Murat Yildizoglu  writes:

> Thanks Alex,
> That opens new and nice perspectives.
>
> I have just thought about another possibility: Since the Sage software
> uses Python as a glue, it must be also possible to use the Sage module
> for LyX to make computations in Python in Sage and include the results
> in the final PDF file.  

There are numerous possibilities using converters like this - ranging
From simple scripts (one can also call R like this if one does not need
a single session and only wants to do simple graphs), to calling complex
simulations... whatever produces graphs. Actually not only graphs, also
text, e.g. tables generated should work with the correct export format?

Alex - I think it would be a good idea to add this to the LyX wiki.

Cheers,

Rainer



> That reminds me that I should check the Sage module for the last
> version of Lyx (have not had any time to look at it yet).
>
> Best regards,
>
> Murat
>
> Alex Vergara Gil a écrit :
>
> 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.
>
> --
> Universite' de Bordeaux CNRS
>
> Prof. Murat Yildizoglu
>
> GREThA (UMR CNRS 5113)
> UNIVERSITE DE BORDEAUX
> GREThA (UMR CNRS 5113)
> MURAT YILDIZOGLU
> 16 AVENUE LEON DUGUIT
> CS 50057
> 33608 PESSAC CEDEX
> FRANCE
>
> Bureau : E-331
>
> yildizoglu.info
>

-- 
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


pgpBotkKNuSAc.pgp
Description: PGP signature


Re: Python Graphics in LyX [was: Python bindings]

2014-06-10 Thread Rainer M Krug
"Alex Vergara Gil"  writes:

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

Skype:  RMkrug

PGP: 0x0F52F982


pgphSDFfXP5gr.pgp
Description: PGP signature


Re: Python Graphics in LyX [was: Python bindings]

2014-06-10 Thread Wolfgang Engelmann
I retryed again and now got the PythonGraphics>LyX converter after 
reconfiguring, but running it gives me:


LaTeX Warning: File `0_home_we_Lyx_PhytonGraphics_example.pdf' not found 
on inp


ut line 80.
shouldn't it load example.pygr, which I selected in my folder 
PhytonGraphics containing all the files supplied by Alex?

Do I have to use instead of view>pdflatex something else for export?
Wolfgang



! Package pdftex.def Error: File 
`0_home_we_Lyx_PhytonGraphics_example.pdf' not


found.


See the pdftex.def package documentation for explanation.

Type H  for immediate help.

...

Am 10.06.2014 09:00, schrieb Wolfgang Engelmann:


Am 09.06.2014 21:42, schrieb Alex Vergara Gil:

   - Original Message -
   From: Wolfgang Engelmann
   To: lyx-users@lists.lyx.org
   Sent: Monday, June 09, 2014 12:55 PM
   Subject: Re: Python Graphics in LyX [was: Python bindings]


   where in lyx is this done?-->
   Define a new converter from Python graphics to EPS as

   python $$i $$o

   Wolfgang


If you have followed the little manual you know in tools - 
preferences there is two options, one that says file types and the 
other says converters

in the first you define the Python graphics file type
in the second you define the converter

regards
Alex



Thanks Alex, still not there.



First: Could one change in the instruction of the PythonGraphics.lyx
Define a new file format, name it Python graphics, extension pygr and 
vector image format ticked
to: Define a new file format in tools>preferences, name it Python 
graphics, extension pygr and vector image format ticked


Second: in Converters - Converter Definitions I guess I have to add 
python $$i $$o in the Converter: line. However, Add on the right side 
of the Converter Definitions is greyed out. So, how do I do that?



Wolfgang






Re: Python Graphics in LyX [was: Python bindings]

2014-06-10 Thread Wolfgang Engelmann


Am 09.06.2014 21:42, schrieb Alex Vergara Gil:

   - Original Message -
   From: Wolfgang Engelmann
   To: lyx-users@lists.lyx.org
   Sent: Monday, June 09, 2014 12:55 PM
   Subject: Re: Python Graphics in LyX [was: Python bindings]


   where in lyx is this done?-->
   Define a new converter from Python graphics to EPS as

   python $$i $$o

   Wolfgang


If you have followed the little manual you know in tools - preferences there is 
two options, one that says file types and the other says converters
in the first you define the Python graphics file type
in the second you define the converter

regards
Alex



Thanks Alex, still not there.



First: Could one change in the instruction of the PythonGraphics.lyx
Define a new file format, name it Python graphics, extension pygr and vector 
image format ticked
to: Define a new file format in tools>preferences, name it Python graphics, 
extension pygr and vector image format ticked



Second: in Converters - Converter Definitions I guess I have to add python $$i 
$$o in the Converter: line. However, Add on the right side of the Converter 
Definitions is greyed out. So, how do I do that?



Wolfgang




Re: Python Graphics in LyX [was: Python bindings]

2014-06-09 Thread Alex Vergara Gil

  - Original Message - 
  From: Wolfgang Engelmann 
  To: lyx-users@lists.lyx.org 
  Sent: Monday, June 09, 2014 12:55 PM
  Subject: Re: Python Graphics in LyX [was: Python bindings]


  where in lyx is this done?-->
  Define a new converter from Python graphics to EPS as

  python $$i $$o

  Wolfgang


If you have followed the little manual you know in tools - preferences there is 
two options, one that says file types and the other says converters
in the first you define the Python graphics file type
in the second you define the converter

regards
Alex

Re: Python Graphics in LyX [was: Python bindings]

2014-06-09 Thread Wolfgang Engelmann

where in lyx is this done?-->
Define a new converter from Python graphics to EPS as

python $$i $$o

Wolfgang

Am 09.06.2014 15:07, schrieb 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.





Re: Python Graphics in LyX [was: Python bindings]

2014-06-09 Thread Alex Vergara Gil
- Original Message - From: "Kornel Benko" Sent: Monday, June 09, 2014 
8:40 AM

Am Montag, 9. Juni 2014 um 08:07:16, schrieb 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

Re: Python Graphics in LyX [was: Python bindings]

2014-06-09 Thread Murat Yildizoglu

Thanks Alex,
That opens new and nice perspectives.

I have just thought about another possibility: Since the Sage software 
uses Python as a glue, it must be also possible to use the Sage module 
for LyX to make computations in Python in Sage and include the results 
in the final PDF file.
That reminds me that I should check the Sage module for the last version 
of Lyx (have not had any time to look at it yet).


Best regards,

Murat

Alex Vergara Gil a écrit :

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.


--
Université de Bordeaux  CNRS 



Prof. Murat Yildizoglu 

GREThA (UMR CNRS 5113)
UNIVERSITE DE BORDEAUX
GREThA (UMR CNRS 5113)
MURAT YILDIZOGLU
16 AVENUE LEON DUGUIT
CS 50057
33608 PESSAC CEDEX
FRANCE

Bureau : E-331

yildizoglu.info