Re: [Matplotlib-users] Matplotlib and Flash

2009-06-13 Thread Troels Kofoed Jacobsen
On Saturday 13 June 2009 22:14:47 Alan Jackson wrote:
> Any suggestions for turning a sequence of Matplotlib plots into a Flash
> movie, on Linux?
>
> I did just notice that R now has that capability built in. 8-)

Use mencoder to make a series of images into a video. Don't know if it 
supports flash. If not you can use ffmpeg to turn a video of a supported format 
into a flash .flv video.

http://ubuntuforums.org/showthread.php?t=499174 gives some hints to mencoder.

ffmpeg is pretty much just: ffmpeg -i in.avi out.flv

Best Regards
Troels Kofoed Jacobsen

--
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Segmentation fault using imshow on large image

2009-04-25 Thread Troels Kofoed Jacobsen
Hi

It could be that you just have to much data for the stack. You can see/set 
your stack size with ulimit -s (on linux/solaris at least). Try to set it to 
unlimited:
ulimit -s unlimited

This has solved similar problems for me in the past.

Best Regards
Troels Kofoed Jacobsen

On Saturday 25 April 2009 16:53:27 Adam Ginsburg wrote:
> Yep, I'm running on a 64 bit machine.  I've been dealing with larger
> than 4GB data files in IDL, but I'd rather use python/numpy/matplotlib
> if possible.
>
> Here's the gdb session.  The error didn't happen in imshow, only when
> I specified show(); I guess that means I must have had ioff() set
> although I don't think that was my default choice last time I used
> matplotlib.
>
>
> milkyway /data/glimpseii $ gdb /usr/local/python/bin/python
> GNU gdb Red Hat Linux (6.3.0.0-1.159.el4rh)
> Copyright 2004 Free Software Foundation, Inc.
> GDB is free software, covered by the GNU General Public License, and you
> are welcome to change it and/or distribute copies of it under certain
> conditions. Type "show copying" to see the conditions.
> There is absolutely no warranty for GDB.  Type "show warranty" for details.
> This GDB was configured as "x86_64-redhat-linux-gnu"...Using host
> libthread_db library "/lib64/tls/libthread_db.so.1".
>
> (gdb) run
> Starting program: /usr/local/python/bin/python
> [Thread debugging using libthread_db enabled]
> [New Thread 182900715072 (LWP 18039)]
> Python 2.5 (r25:51908, Dec 22 2006, 16:08:43)
> [GCC 3.4.6 20060404 (Red Hat 3.4.6-3)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>
> >>> import matplotlib,scipy,numpy,pyfits
> >>> from pylab import *
> >>> f = pyfits.open('GLM_00600+_mosaic_I3.fits')
> >>> imshow(f[0].data)
>
> 
>
> >>> show()
>
> Program received signal SIGSEGV, Segmentation fault.
> [Switching to Thread 182900715072 (LWP 18039)]
> 0x002aa3170ab5 in _image_module::fromarray (this=Variable "this"
> is not available.
> ) at src/image.cpp:872
> 872 src/image.cpp: No such file or directory.
> in src/image.cpp
> Current language:  auto; currently c++
> (gdb)
>
>
> I've never used gdb before, so is there anything else I should be
> doing at this point?
>
> Thanks,
> Adam
>
> On Fri, Apr 24, 2009 at 7:52 AM, Michael Droettboom  
wrote:
> > On my machine (32-bit Fedora 10 with 2GB RAM), it chugs along swapping
> > for a lng time and then fails with a Python MemoryError exception --
> > which is at least reasonable.
> >
> > I suspect you're running on a 64-bit machine and we're running into some
> > sort of non-64-bit-clean issue.  We try to be 64-bit clean, but it
> > doesn't get verified on a regular basis, and not all of us (myself
> > included) are running 64-bit OSes.
> >
> > Can you try running python inside of gdb and getting a traceback?  That
> > might provide some clues.
> >
> > We can estimate a little bit as to the memory requirements -- though it's
> > hard to account for everything.
> >
> > Input array is (10370, 9320) x 4 = 386MB
> > This array is always converted to doubles to convert to colors (this is
> > probably a place ripe for opimtization) so you get also 786MB. Then this
> > gets converted to an RGBA array for another 386MB
> >
> > Mike
> >
> > Adam Ginsburg wrote:
> >> Hi, I've been getting a segmentation fault when trying to display
> >> large images.  A transcript of a sample session is below.  I'm using
> >> the TkAgg backend, and I am using numpy, but otherwise I have made no
> >> modifications to the matplotlib setup.
> >>
> >>
> >> milkyway /data/glimpseii $ alias pylab
> >> alias pylab='/usr/local/adm/config/python/bin/ipython -pylab -log'
> >> milkyway /data/glimpseii $ pylab
> >> Activating auto-logging. Current session state plus future input saved.
> >> Filename   : ipython_log.py
> >> Mode   : rotate
> >> Output logging : False
> >> Raw input log  : False
> >> Timestamping   : False
> >> State  : active
> >> Python 2.5 (r25:51908, Dec 22 2006, 16:08:43)
> >> Type "copyright", "credits" or "license" for more information.
> >>
> >> IPython 0.9.1 -- An enhanced Interactive Python.
> >> ? -> Introduction and overview of IPython's features.
> >> %quickref ->

Re: [Matplotlib-users] making the space between ticks

2009-04-06 Thread Troels Kofoed Jacobsen
On Monday 06 April 2009 20:15:47 Jouni K. Seppänen wrote:
> Chaitanya Krishna  writes:
> > That is, when I use pylab.ylabel(r'$V [A^{3}]$') I don't get any space
> > in between V and [.
>
> Like TeX, matplotlib ignores spaces in math mode and uses spacing
> derived from the usual roles of the symbols. You need to use an explicit
> command to add space.
>
> > I also tried using the math mode spacing for Latex, So, if I try to do
> > pylab.ylabel(r'$V\;[A^{3}]$'), I only get V and not even A^3.
>
> On the current trunk, and on the v0_98_5 maintenance branch, that works
> fine. At least the following spacing commands seem to work: r'$a\ b$',
> r'$a\,b$', r'$a\;b$', r'$a\!b$' (negative space) and r'$a\quad b$' work.
> Perhaps you can update to a newer version of matplotlib?

It is also possible to mix math mode and non-math mode. 

ylabel(r'$V$ [\AA$^3$]')

(also note that units by convention are not italic...)

Best regards
Troels Kofoed Jacobsen

--
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Possible to cut out pease of axes

2009-03-31 Thread Troels Kofoed Jacobsen
Hi All

Is it possible to cut out a peace of an axes, as shown in the attached mockup. 
This could typically be used if you have some important data in the interval 
[0,6] and some other important data in another interval [30,40] as shown in 
the figure.

Best Regards
Troels Kofoed Jaobsen


mockup.pdf
Description: Adobe PDF document
--
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Loading and saving arbitrary objects with attributes

2008-03-26 Thread Troels Kofoed Jacobsen
Hi.

Does anyone know how to save and load an arbitrary object (e.g a numpy
array) to a file, and load it again?

I cannot use savetxt and loadtxt as these only stores the numbers.  I
think I'm looking for some binary format.

Best regards / Med Venlig Hilsen
Troels Kofoed Jacobsen

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] variable line thickness in a plot

2008-03-11 Thread Troels Kofoed Jacobsen
On Tue, Mar 11, 2008 at 01:23:04PM -0700, eliss wrote:
> 
>On 3/11/08, Troels Kofoed Jacobsen <[EMAIL PROTECTED]> wrote:
> 
>  On Tue, Mar 11, 2008 at 12:45:21PM -0700, eliss wrote:
>  >
>  >Hi, does anyone know of a way to create lines with variable
>  thickness
>  >and color when doing a plot?
>  >Basically, I'd like to have a third dimension represented using
>  >thickness. The API for the plot function states that the line
>  thickness
>  >can only be a single floating point number.
>  >Thanks
>  I don't know if this is the easiest way, but it can be done with
>  clever use of fill:
>  from pylab import *
>  x = linspace(0,10,101)
>  y = cos(x)
>  z = sin(3*x)+2
>  zn = 0.05*z
>  xs, ys = mlab.poly_between(x, y-zn, y+zn)
>  fill(xs, ys)
>  show()
>  Best Regards
> 
> 
>Thanks for the reply. I couldn't find the "poly_between" function in
>mlab. I imported my mlab, and did dir(mlab) but that method doesn't
>show up in there. I tried redownloading the latest version of
>matplotlib as well. Am I missing a library?
> 
> References
> 
>1. mailto:[EMAIL PROTECTED]

> -
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users

I have version 0.91.2 of matplotlib and for me the function is there.

(I found it in the fill_between.py example)


-- 
Troels Kofoed Jacobsen
[EMAIL PROTECTED]
tel: +45 20880798

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] variable line thickness in a plot

2008-03-11 Thread Troels Kofoed Jacobsen
On Tue, Mar 11, 2008 at 12:45:21PM -0700, eliss wrote:
> 
>Hi, does anyone know of a way to create lines with variable thickness
>and color when doing a plot?
>Basically, I'd like to have a third dimension represented using
>thickness. The API for the plot function states that the line thickness
>can only be a single floating point number.
>Thanks

> -
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users

I don't know if this is the easiest way, but it can be done with clever use of 
fill:

from pylab import *

x = linspace(0,10,101)
y = cos(x)
z = sin(3*x)+2
zn = 0.05*z

xs, ys = mlab.poly_between(x, y-zn, y+zn)
fill(xs, ys)
show()

Best Regards

-- 
Troels Kofoed Jacobsen
[EMAIL PROTECTED]
tel: +45 20880798

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Transparent?

2008-03-07 Thread Troels Kofoed Jacobsen
Hi all

Can i make something transparent?

E.g the markerfacecolor?


--
Med Venlig Hilsen /Best Regards
Troels Kofoed Jacobsen

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Extended load function

2008-03-03 Thread Troels Kofoed Jacobsen
Oups, now i have attached the file

-- Forwarded message --
From: Troels Kofoed Jacobsen <[EMAIL PROTECTED]>
Date: Mon, Mar 3, 2008 at 3:51 PM
Subject: Extended load function
To: matplotlib-users@lists.sourceforge.net


Hi everybody

I have modified the load function (in matplotlib.mlab) to be able to load
strings e.g for use as xticks. Anyone willing to test and comment, 'cause
when i'm done i'll send it as a patch.

The usage is as follows:

from reload import load
s,A,B=reload('data.dat',usecols=(1,2),unpack=True,string=0)

here the data file is like:
# Molecule Energy1 Energy2
Fe -831-832
Pt -923-932

It can also be used without unpack, but only one array of strings can be
extracted.

-- 
Med Venlig Hilsen / Best regards

Troels Kofoed Jacobsen



-- 
Med Venlig Hilsen

Troels Kofoed Jacobsen


reload.py
Description: application/python
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Extended load function

2008-03-03 Thread Troels Kofoed Jacobsen
Hi everybody

I have modified the load function (in matplotlib.mlab) to be able to load
strings e.g for use as xticks. Anyone willing to test and comment, 'cause
when i'm done i'll send it as a patch.

The usage is as follows:

from reload import load
s,A,B=reload('data.dat',usecols=(1,2),unpack=True,string=0)

here the data file is like:
# Molecule Energy1 Energy2
Fe -831-832
Pt -923-932

It can also be used without unpack, but only one array of strings can be
extracted.

-- 
Med Venlig Hilsen / Best regards

Troels Kofoed Jacobsen
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Use xticks from file

2008-02-25 Thread Troels Kofoed Jacobsen
Hi Guys

Is there an eays way to plot a number vs a label from a file?

Here is an example
I have a datafile like this:
#Aa Bb  nA  nB  SurfBulksegEnergy
Fe  Cr  19  1   -909.065612 -909.060586 -0.100520
Fe  Ni  19  1   -855.708731 -855.700865 -0.157320
Fe  Mo  19  1   -810.257339 -810.252167 -0.103440

I want to plot the last row vs the second row.

Now i have to do:
y,dummy = load('data.dat',usecols=(6,6),unpack=True)
xticks=xticks(arange(3),('Cr','Ni','Mo'))
plot(y)

Is there an easy way to do this?

And why does usecols=(6) not work?

-- 
Med Venlig Hilsen / Best Regards

Troels Kofoed Jacobsen
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Different matplotlibrc

2008-02-22 Thread Troels Kofoed Jacobsen
Thanks guys.

The env variable method doesn't work, but I can use the file in current dir
for now (will just symlink from the file i want).

Best Regards T.

On Fri, Feb 22, 2008 at 2:39 PM, Darren Dale <[EMAIL PROTECTED]>
wrote:

> On Friday 22 February 2008 04:45:46 am Troels Kofoed Jacobsen wrote:
> > Hey everybody
> >
> > Is there at way to make matplotlib use a different matplotlibrc than the
> > one in $HOME/.matplotlib. This is because I want to be able to use
> > different settings for different plots, e.g one for publishable plots,
> and
> > one for daily plotting.
> >
> > Best regards
> >
> > Troels Kofoed Jacobsen
>
> Try saving a matplotlibrc file in your current working directory.
> Matplotlib
> looks there first.
>
> Darren
>
> -
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>



-- 
Med Venlig Hilsen

Troels Kofoed Jacobsen
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Different matplotlibrc

2008-02-22 Thread Troels Kofoed Jacobsen
Hey everybody

Is there at way to make matplotlib use a different matplotlibrc than the one
in $HOME/.matplotlib. This is because I want to be able to use different
settings for different plots, e.g one for publishable plots, and one for
daily plotting.

Best regards

Troels Kofoed Jacobsen
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] xpdf distiller: page doesn't fit graph

2007-05-10 Thread Troels Kofoed Jacobsen
It is working great if I just use .eps

Thanks guys.,,

On Thu, May 10, 2007 at 03:22:20PM -0400, Darren Dale wrote:
> On Thursday 10 May 2007 02:39:51 pm Troels Kofoed Jacobsen wrote:
> > I want to make some good vector graphs to include in LaTeX.
> >
> > I use
> > backend   : PS
> > ps.papersize  : auto
> > ps.usedistiller   : xpdf
> >
> > My problem is that when i export the graphs [savefig('test')] the
> > exported graph is in the middle of a large page, which isn't suitable
> > for inclusion in LaTeX.
> 
> ps.papersize: auto picks the smallest standard papersize that will 
> accommodate 
> your figure.
> 
> > How can I make the page the same size as the graph?
> 
> Try saving an eps file instead.
> 
> > Please help me. Matplotlib makes the nicest graphs i know -- don't make
> > me use Matlab.
> 
> ...

-- 
Troels Kofoed Jacobsen
[EMAIL PROTECTED]
tel: +45 20880798

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] xpdf distiller: page doesn't fit graph

2007-05-10 Thread Troels Kofoed Jacobsen
I want to make some good vector graphs to include in LaTeX.

I use
backend   : PS
ps.papersize  : auto
ps.usedistiller   : xpdf  

My problem is that when i export the graphs [savefig('test')] the 
exported graph is in the middle of a large page, which isn't suitable 
for inclusion in LaTeX.

How can I make the page the same size as the graph?

Please help me. Matplotlib makes the nicest graphs i know -- don't make 
me use Matlab.

Best Regards
T.

-- 
Troels Kofoed Jacobsen
[EMAIL PROTECTED]
tel: +45 20880798

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users