[BioPython] Plotting with python

Michiel de Hoon mdehoon@ims.u-tokyo.ac.jp
Sat, 13 Apr 2002 20:54:44 +0900


--------------000206090108020301070401
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Dear bio-pythoneers,

Thank you for all your suggestions on plotting with Python. I ended up 
writing a short plotting code in Python with Tkinter, it is very very 
simple but it shows plots on my screen. If anybody is interested, I can 
make the file available. Using Jython is a good suggestion, but I was 
trying to find something easy and portable, and Tkinter gets the job 
done. Unfortunately I don't have matlab on my machine, so that was not 
an option.

The Gnuplot.py package and the SciPy graphing module are also good 
options. I am running Python under cygwin on a Windows machine though, 
and cygwin seems to have some problems with pipes and threads. As 
Gnuplot.py and SciPy rely on that, I couldn't get them to work on my 
machine. I had similar problems getting Blt to work. If you can get it 
to work on your machine, one of these is probably the best option for now.

For those of you that have X-windows available, the Python Gist package 
may be your best choice. It provides all the plotting capabilities you 
would normally find in commercial codes only. Unfortunately, it would be 
very difficult to port Python Gist to Windows or Macintosh. If anybody 
is interested in using Python Gist under X-windows, I can help you to 
set it up.

Thanks again -- maybe I will meet some of you at RECOMB next week.

Michiel de Hoon
University of Tokyo, Human Genome Center.

------------------------------------------------------------------------

>Jython lets you code in python and use java for graphics.
>
------------------------------------------------------------------------

> I've been using this Gnuplot.py package
> ( http://www-heller.harvard.edu/~mhagger/Gnuplot/Gnuplot.html ),
> seems to do the job, including interactive updating. . . probably 
> similar to SciPy's Gnuplot interface I guess.
> You need Gnuplot installed of course ....

------------------------------------------------------------------------

>Hi Michiel,
>  I'm in a similar line of work (numerical analysis of microarray data),
>and have had the same frustrations with python.  the Blt package of
>Pmw (python mega-widgets) plots line vectors and scatter plots nicely.
>With python threading, you can get the interactivity you desire.  And,
>though I haven't tested this myself, I think getting it to work in 
>windows is not a problem (but it works fine for me in Xwindows).
>  hope it helps.  Let me know if you find something better!
>
------------------------------------------------------------------------

>Have you had a chance to look at SciPy yet?
>
>    http://www.scipy.org
>
>It looks like they have a nice graphing module that you can use:
>
>    http://www.scipy.org/site_content/tutorials/plot_tutorial
>
>scipy's graphing module uses gnuplot underneath, and is portable on both
>Windows and X Windows.
>
>Good luck to you!
>
------------------------------------------------------------------------

>I've been using python with Matlab with excellent results.  There's a
>pymat module that will interface python with Matlab via Matlab's C
>API.  You end up with an interactive Python interface to Matlab.  It's
>not entirely clean (e.g. you have to tell it how many return values to
>give you), but it does the job.
>
>Jeff
>
>
>On Sun, Apr 07, 2002 at 03:00:07PM +0900, Michiel de Hoon wrote:
>
>>> I have been using python with C extension modules to do numerical 
>>> analysis of gene expression data (cDNA microarray). While python is 
>>> excellent for doing numerical analysis, the problem is that there does 
>>> not seem to be a good package for creating plots with Python, except for 
>>> Gist, which uses X Windows and does not run under Windows. The other 
>>> packages that I have found on the web do not support interactive work 
>>> (that is, as soon as a graphics window is opened, the python prompt is 
>>> not available until the window is closed). Commercial codes such as 
>>> matlab support such interactive work, and it would be nice if Python 
>>> could do the same. Does anybody have any suggestions on what to use for 
>>> scientific plotting with Python?
>>> Thanks -- Michiel.
>>> 
>>> -- 
>>> Michiel de Hoon, Postdoctoral Fellow
>>> University of Tokyo, Institute of Medical Science
>>> Human Genome Center
>>> 4-6-1 Shirokane-dai, Minato-ku
>>> Tokyo 108-8639
>>> Japan
>>> http://bonsai.ims.u-tokyo.ac.jp/~mdehoon
>>  
>>
-- 
Michiel de Hoon, Postdoctoral Fellow
University of Tokyo, Institute of Medical Science
Human Genome Center
4-6-1 Shirokane-dai, Minato-ku
Tokyo 108-8639
Japan
http://bonsai.ims.u-tokyo.ac.jp/~mdehoon


--------------000206090108020301070401
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<html>
<head>
</head>
<body>
Dear bio-pythoneers,<br>
<br>
Thank you for all your suggestions on plotting with Python. I ended up writing
a short plotting code in Python with Tkinter, it is very very simple but
it shows plots on my screen. If anybody is interested, I can make the file
available. Using Jython is a good suggestion, but I was trying to find something
easy and portable, and Tkinter gets the job done. Unfortunately I don't have
matlab on my machine, so that was not an option.<br>
<br>
The Gnuplot.py package and the SciPy graphing module are also good options.
I am running Python under cygwin on a Windows machine though, and cygwin
seems to have some problems with pipes and threads. As Gnuplot.py and SciPy
rely on that, I couldn't get them to work on my machine. I had similar problems
getting Blt to work. If you can get it to work on your machine, one of these
is probably the best option for now.<br>
<br>
For those of you that have X-windows available, the Python Gist package may
be your best choice. It provides all the plotting capabilities you would
normally find in commercial codes only. Unfortunately, it would be very difficult
to port Python Gist to Windows or Macintosh. If anybody is interested in
using Python Gist under X-windows, I can help you to set it up.<br>
<br>
Thanks again -- maybe I will meet some of you at RECOMB next week.<br>
<br>
Michiel de Hoon<br>
University of Tokyo, Human Genome Center.<br>
<br>
<hr width="100%" size="2">
<blockquote type="cite">
  <pre wrap="">Jython lets you code in python and use java for graphics.</pre>
  </blockquote>
  <hr width="100%" size="2">
  <blockquote type="cite">I've been using this Gnuplot.py package <br>
(<a class="moz-txt-link-freetext" href="http://www-heller.harvard.edu/%7Emhagger/Gnuplot/Gnuplot.html">
http://www-heller.harvard.edu/~mhagger/Gnuplot/Gnuplot.html</a>
), <br>
seems to do the job, including interactive updating. . . probably  similar
to SciPy's Gnuplot interface I guess. <br>
You need Gnuplot installed of course .... <br>
    </blockquote>
    <hr width="100%" size="2">
    <blockquote type="cite">
      <div class="moz-text-plain" wrap="true" graphical-quote="true" style="font-family: Courier New; font-size: 13px; ">
      <pre wrap="">Hi Michiel,<br>  I'm in a similar line of work (numerical analysis of microarray data),<br>and have had the same frustrations with python.  the Blt package of<br>Pmw (python mega-widgets) plots line vectors and scatter plots nicely.<br>With python threading, you can get the interactivity you desire.  And,<br>though I haven't tested this myself, I think getting it to work in <br>windows is not a problem (but it works fine for me in Xwindows).<br>  hope it helps.  Let me know if you find something better!</pre>
      </div>
      </blockquote>
      <hr width="100%" size="2">
      <blockquote type="cite"></blockquote>
        <blockquote type="cite">
          <pre wrap="">Have you had a chance to look at SciPy yet?<br><br>    <a class="moz-txt-link-freetext" href="http://www.scipy.org">http://www.scipy.org</a><br><br>It looks like they have a nice graphing module that you can use:<br><br>    <a class="moz-txt-link-freetext" href="http://www.scipy.org/site_content/tutorials/plot_tutorial">http://www.scipy.org/site_content/tutorials/plot_tutorial</a><br><br>scipy's graphing module uses gnuplot underneath, and is portable on both<br>Windows and X Windows.<br><br>Good luck to you!</pre>
          </blockquote>
          <hr width="100%" size="2">
          <blockquote type="cite">
            <pre wrap="">I've been using python with Matlab with excellent results.  There's a<br>pymat module that will interface python with Matlab via Matlab's C<br>API.  You end up with an interactive Python interface to Matlab.  It's<br>not entirely clean (e.g. you have to tell it how many return values to<br>give you), but it does the job.<br><br>Jeff<br><br><br>On Sun, Apr 07, 2002 at 03:00:07PM +0900, Michiel de Hoon wrote:<br></pre>
            <blockquote type="cite">
              <pre wrap=""><span class="moz-txt-citetags">&gt; </span>I have been using python with C extension modules to do numerical <br><span class="moz-txt-citetags">&gt; </span>analysis of gene expression data (cDNA microarray). While python is <br><span class="moz-txt-citetags">&gt; </span>excellent for doing numerical analysis, the problem is that there does <br><span class="moz-txt-citetags">&gt; </span>not seem to be a good package for creating plots with Python, except for <br><span class="moz-txt-citetags">&gt; </span>Gist, which uses X Windows and does not run under Windows. The other <br><span class="moz-txt-citetags">&gt; </span>packages that I have found on the web do not support interactive work <br><span class="moz-txt-citetags">&gt; </span>(that is, as soon as a graphics window is opened, the python prompt is <br><span class="moz-txt-citetags">&gt; </span>not available until the window is closed). Commercial codes such as <br><span class="moz-txt-citetags"
>&gt; </span>matlab support such interactive work, and it would be nice if Python <br><span class="moz-txt-citetags">&gt; </span>could do the same. Does anybody have any suggestions on what to use for <br><span class="moz-txt-citetags">&gt; </span>scientific plotting with Python?<br><span class="moz-txt-citetags">&gt; </span>Thanks -- Michiel.<br><span class="moz-txt-citetags">&gt; </span><br><span class="moz-txt-citetags">&gt; </span>-- <br><span class="moz-txt-citetags">&gt; </span>Michiel de Hoon, Postdoctoral Fellow<br><span class="moz-txt-citetags">&gt; </span>University of Tokyo, Institute of Medical Science<br><span class="moz-txt-citetags">&gt; </span>Human Genome Center<br><span class="moz-txt-citetags">&gt; </span>4-6-1 Shirokane-dai, Minato-ku<br><span class="moz-txt-citetags">&gt; </span>Tokyo 108-8639<br><span class="moz-txt-citetags">&gt; </span>Japan<br><span class="moz-txt-citetags">&gt; </span><a class="moz-txt-link-freetext" href="http://bonsai.ims.u-tokyo.a
c.jp/%7Emdehoon">http://bonsai.ims.u-tokyo.ac.jp/~mdehoon</a><br><span class="moz-txt-citetags"> </span><span class="moz-txt-citetags"> </span></pre>
              </blockquote>
              </blockquote>
              <pre class="moz-signature" cols="$mailwrapcol">-- 
Michiel de Hoon, Postdoctoral Fellow
University of Tokyo, Institute of Medical Science
Human Genome Center
4-6-1 Shirokane-dai, Minato-ku
Tokyo 108-8639
Japan
<a class="moz-txt-link-freetext" href="http://bonsai.ims.u-tokyo.ac.jp/~mdehoon">http://bonsai.ims.u-tokyo.ac.jp/~mdehoon</a>
</pre>
              </body>
              </html>

--------------000206090108020301070401--