[Matplotlib-users] nonlinear axes for imshow

2009-10-12 Thread thkoe002
Hello, I have the following problem. I want the axes (only the y-axis, to be exact) of a imshow() graph to be nonlinear. By default, the axis goes linearily from 0 to (number of pixels). With the [extent] keyword, I can change that to going linearly from (arbitrary start) to (arbitrary end). Now,

[Matplotlib-users] zooming and panning with blit

2009-10-12 Thread Chengkun Huang
Hi all, I am just started to use matplotlib and have a question about using blit method to animate plots. I wrote something like this to show the initial plot (other part of the code not shown): l1, = p1.plot(lineout, animated=True) p1.set_xlabel(xlabel)

[Matplotlib-users] Draw twin axes below main axes

2009-10-12 Thread Georg Brandl
Hi, I want to make a plot with ordinary subplots, each of which has a second axes set created with twinx(). Now, the second axes are always drawn over the first, but I want the "main" data, which is associated with the left Y axis, to be in front. (If I understand the code correctly, the zorder d

[Matplotlib-users] Little issue with blitting technique

2009-10-12 Thread Laurent Dufrechou
Hello, I've just discovered blitting technique to improve performances. I'm using this example http://matplotlib.sourceforge.net/examples/animation/animation_blit_qt4. html I encounter an issue if instead of using subplot I use add_axes method to hand define where I want my plot. In this

[Matplotlib-users] Background colours

2009-10-12 Thread mariama...@aquaterraenerg
Hi, I am quite new to python and matplotlib!! When plotting a simple graph using python and matplotlib my plot appears however the area (background) where my x.label and y.label and axes limits lie is grey, does anyone know how to set this to another color ie. white Thanks Maria -- View th

[Matplotlib-users] Some icons do not showup after packaging with py2exe or pyinstaller

2009-10-12 Thread Laurent Dufrechou
Hello, Whether method I use to package my python app, I always reach the issue where the toolbar does not display some icons whiel the "subplot" is well displayed. Each time the packaging method copy mpl-data where the .exe is created so file are or should be at the right location. Does anybo

Re: [Matplotlib-users] Background colours

2009-10-12 Thread Matthias Michler
On Wednesday 07 October 2009 16:15:03 mariama...@aquaterraenerg wrote: > Hi, I am quite new to python and matplotlib!! > > When plotting a simple graph using python and matplotlib my plot appears > however the area (background) where my x.label and y.label and axes limits > lie is grey, does anyone

[Matplotlib-users] MathTextParser, maxdict ... Assertion failed!

2009-10-12 Thread Cédrick FAURY
Hello, I did an application that uses bitmaps constructed with MathTextParser as described in the example http://matplotlib.sourceforge.net/examples/user_interfaces/mathtext_wx.html (I work with Windows XP, python 2.5, Matplotlib 0.98.5 and wxPython 2.8.10.1) After making a lot of these bitm

Re: [Matplotlib-users] MathTextParser, maxdict ... Assertion failed!

2009-10-12 Thread Michael Droettboom
Cédrick FAURY wrote: Hello, I did an application that uses bitmaps constructed with MathTextParser as described in the example http://matplotlib.sourceforge.net/examples/user_interfaces/mathtext_wx.html (I work with Windows XP, python 2.5, Matplotlib 0.98.5 and wxPython 2.8.10.1) After maki

[Matplotlib-users] unclutter the axis

2009-10-12 Thread Ernest Adrogué
hi, is there a way to put a label every two o three ticks, instead of putting it on every tick? the following works but it's a little cumbersome: ax.set_yticklabels([pos % 2 != 0 and '%.2f' % num or '' for pos, num in enumerate(ax.get_yticks())]) cheers, Ernest --

Re: [Matplotlib-users] MathTextParser, maxdict ... Assertion failed!

2009-10-12 Thread Cédrick FAURY
Thank you for responding so quickly !! I don't think these problems are related. One is a cache of math expression images, the other is a cache of fonts. I know ... and i found a lot of way to reproduce the same crash... I am unable to reproduce this on Matplotlib 0.98.5.3 on Linux (don't hav

Re: [Matplotlib-users] MathTextParser, maxdict ... Assertion failed!

2009-10-12 Thread Michael Droettboom
Cédrick FAURY wrote: > Thank you for responding so quickly !! > >> I don't think these problems are related. One is a cache of math >> expression images, the other is a cache of fonts. > I know ... and i found a lot of way to reproduce the same crash... >> I am unable to reproduce this on Matplot

Re: [Matplotlib-users] MathTextParser, maxdict ... Assertion failed!

2009-10-12 Thread Cédrick FAURY
>> This script does'nt work (it causes a PyAssertion error : invalid >> stock id) > If it's a PyAssertion error, it should have a traceback. Is there not > one? No, this problem is not related with Matplotlib : the PyAssertion error occurs when creating the wx.Menu ... Cédrick --

[Matplotlib-users] Re verse colormapping/LUT?

2009-10-12 Thread thkoe002
Hi, following problem: Let's say I have a couple of .png images that were produced with imshow() and the jet() (==default) colormap. The original data was 8 bit intensity data, now the images are 24 bit with false colors / pseudocolors. Now, is there a (simple?) way to calculate back from those 2

Re: [Matplotlib-users] plot color as a function of values?

2009-10-12 Thread thkoe002
Maybe a little shorter is the where() keyword, and even that can be omitted: ax.plot(t[where(s>=0)],s[where(s>=0)],"g") ax.plot(t[where(s<0)],s[where(s<0)],"r") or, shorter: ax.plot(t[s>=0],s[s>=0],"g") ax.plot(t[s<0],s[s<0],"r") cheers Thomas Xavier Gnata-2 wrote: > > Hi, > > Imagine yo

[Matplotlib-users] ImportError: No module named ma

2009-10-12 Thread Chaitanya Krishna
Hi all, I am on Mac OS 10.5 and numpy 1.3.0 and matplotlib 0.91.1. When I run a qtdemo script, it fails with File "/Library/Python/2.5/site-packages/matplotlib-0.91.1-py2.5-macosx-10.5-i386.egg/matplotlib/numerix/ma/__init__.py", line 16, in from numpy.core.ma import * ImportError: No modul

Re: [Matplotlib-users] ImportError: No module named ma

2009-10-12 Thread Robert Kern
On 2009-10-12 11:58 AM, Chaitanya Krishna wrote: > Hi all, > > I am on Mac OS 10.5 and numpy 1.3.0 and matplotlib 0.91.1. > > When I run a qtdemo script, it fails with > File > "/Library/Python/2.5/site-packages/matplotlib-0.91.1-py2.5-macosx-10.5-i386.egg/matplotlib/numerix/ma/__init__.py", > lin

Re: [Matplotlib-users] ImportError: No module named ma

2009-10-12 Thread Chaitanya Krishna
Hi all, numpy.__file__ gives 1.3.0 >>> import numpy >>> print numpy.__file__ /Library/Python/2.5/site-packages/numpy-1.3.0-py2.5-macosx-10.5-i386.egg/numpy/__init__.pyc Chaitanya On Mon, Oct 12, 2009 at 7:11 PM, Robert Kern wrote: > On 2009-10-12 11:58 AM, Chaitanya Krishna wrote: >> Hi all, >

[Matplotlib-users] Errors with PDF (TeX-string) output using Qt4Agg

2009-10-12 Thread PHobson
Group, This error occurs for me with Matplotlib 0.99.1, Python 2.5.4 and 2.6.2, while using the Qt4Agg backend on Windows XP. Basically, savefig('aweomse_plot.pdf') barfs if I have some math text in there. For example: -- |C:\Documents and Settin

Re: [Matplotlib-users] ImportError: No module named ma

2009-10-12 Thread Robert Kern
On 2009-10-12 12:19 PM, Chaitanya Krishna wrote: > Hi all, > > numpy.__file__ gives 1.3.0 > import numpy print numpy.__file__ > /Library/Python/2.5/site-packages/numpy-1.3.0-py2.5-macosx-10.5-i386.egg/numpy/__init__.pyc Ah, right. I'm sorry. numpy.core.ma is not the location of that subp

Re: [Matplotlib-users] Errors with PDF (TeX-string) output using Qt4Agg

2009-10-12 Thread Jouni K . Seppänen
writes: > |C:\Documents and Settings\phobson>ipython26 -pylab Could you try this in plain Python? I'm asking because you seem to be getting an IPython warning about a possibly corrupted traceback: > ERROR: An unexpected error occurred while tokenizing input > The following traceback may be corr

Re: [Matplotlib-users] plot color as a function of values?

2009-10-12 Thread Xavier Gnata
ax.plot(t[s>=0],s[s>=0],"g") ax.plot(t[s<0],s[s<0],"r") Whaou! That's what I call a nice pythonic syntax. XAvier > Maybe a little shorter is the where() keyword, and even that can be omitted: > > ax.plot(t[where(s>=0)],s[where(s>=0)],"g") > ax.plot(t[where(s<0)],s[where(s<0)],"r") > > or, short

Re: [Matplotlib-users] Errors with PDF (TeX-string) output using Qt4Agg

2009-10-12 Thread PHobson
Sheesh it's been a weird day. I failed to reply to the whole list. Jouni, sorry about the duplciate message... > writes: > > |C:\Documents and Settings\phobson>ipython26 -pylab > > From: Jouni K. Seppänen [mailto:j...@iki.fi] Could you try this in > plain Python? I'm asking because you seem

Re: [Matplotlib-users] plot color as a function of values?

2009-10-12 Thread Eric Firing
Xavier Gnata wrote: > ax.plot(t[s>=0],s[s>=0],"g") > ax.plot(t[s<0],s[s<0],"r") > I don't think it does what you want, though, unless you are plotting markers, not lines. With lines, you will have line segments approximately on the x-axis across the gaps. Using masked arrays avoids that. Th

Re: [Matplotlib-users] nonlinear axes for imshow

2009-10-12 Thread Eric Firing
thkoe002 wrote: > Hello, > > I have the following problem. I want the axes (only the y-axis, to be exact) > of a imshow() graph to be nonlinear. By default, the axis goes linearily > from 0 to (number of pixels). With the [extent] keyword, I can change that > to going linearly from (arbitrary star

Re: [Matplotlib-users] ImportError: No module named ma

2009-10-12 Thread Chaitanya Krishna
Hi, I solved it by installing matplotlib 0.99. But, on Mac 10.5 when I used easy_install matplotlib, it was still saying that 0.91 was the latest and I couldn't install it. Finally I had to download the egg and manually install it (easy_install --install-dir) Cheers, Chaitanya On Mon, Oct 12, 20

Re: [Matplotlib-users] Errors with PDF (TeX-string) output using Qt4Agg

2009-10-12 Thread Jouni K . Seppänen
writes: > File "C:\Python25\Lib\site-packages\matplotlib\backends\backend_pdf.py", > line 1378, in draw_mathtext > self.file.output(self.encode_string(unichr(num), fonttype), Op.show) > ValueError: unichr() arg not in range(0x1) (narrow Python build) Right, IPython really had mangled

Re: [Matplotlib-users] ImportError: No module named ma

2009-10-12 Thread Robert Kern
On 2009-10-12 15:16 PM, Chaitanya Krishna wrote: > Hi, > > I solved it by installing matplotlib 0.99. But, on Mac 10.5 when I > used easy_install matplotlib, it was still saying that 0.91 was the > latest and I couldn't install it. Finally I had to download the egg > and manually install it (easy_i

Re: [Matplotlib-users] Errors with PDF (TeX-string) output using Qt4Agg

2009-10-12 Thread Michael Droettboom
On 10/12/2009 04:17 PM, Jouni K. Seppänen wrote: > writes: > > >>File "C:\Python25\Lib\site-packages\matplotlib\backends\backend_pdf.py", >> line 1378, in draw_mathtext >> self.file.output(self.encode_string(unichr(num), fonttype), Op.show) >> ValueError: unichr() arg not in range(0

Re: [Matplotlib-users] ImportError: No module named ma

2009-10-12 Thread John Hunter
On Mon, Oct 12, 2009 at 3:21 PM, Robert Kern wrote: > On 2009-10-12 15:16 PM, Chaitanya Krishna wrote: >> Hi, >> >> I solved it by installing matplotlib 0.99. But, on Mac 10.5 when I >> used easy_install matplotlib, it was still saying that 0.91 was the >> latest and I couldn't install it. Finally

Re: [Matplotlib-users] Errors with PDF (TeX-string) output using Qt4Agg

2009-10-12 Thread PHobson
Jouni, I found the error! I got bored this past weekend and changed my mathtext.fontset to 'stixsans' just to see hopw it would look -- and then forgot about it. Changing that value back to 'cm' let's my original code and pyTest.py run without errors. I really appreciate your help with this an

Re: [Matplotlib-users] ImportError: No module named ma

2009-10-12 Thread Robert Kern
BTW, please do not Cc: me. I am subscribed to the list and read through GMane. It's annoying to get list replies to my email where I don't want them. On 2009-10-12 15:38 PM, John Hunter wrote: > On Mon, Oct 12, 2009 at 3:21 PM, Robert Kern wrote: >> On 2009-10-12 15:16 PM, Chaitanya Krishna wrot

Re: [Matplotlib-users] Errors with PDF (TeX-string) output using Qt4Agg

2009-10-12 Thread PHobson
Mike, Thanks for the reply. I found that I had (on a whim) set my mathtext.fontset to stixsans and then forgot about it. Returning that value to cm fixes my issues. In short, I'm all squared away now. Thanks! Paul M. Hobson > -Original Message- > From: Michael Droett

Re: [Matplotlib-users] Errors with PDF (TeX-string) output using Qt4Agg

2009-10-12 Thread Michael Droettboom
Thanks. On further investigation, I was reminded that stixsans (or anything not in the BMP) doesn't work with Type 42 fonts. The way the PDF spec forces you to deal with them, if it's even possible, is really hairy. So to solve your problem you can either a) not use stixsans, or b) use Type

Re: [Matplotlib-users] making horizontal axes labels in plots

2009-10-12 Thread Jae-Joon Lee
First of all, I recommend you to use spines instead of SubplotZero of axes_grid toolkit. http://matplotlib.sourceforge.net/examples/pylab_examples/spine_placement_demo.html If you use axes_grid toolkit, keep in mind that some axis-related command of matplotlib may not work. Please take a look at

Re: [Matplotlib-users] Draw twin axes below main axes

2009-10-12 Thread Jae-Joon Lee
On Fri, Oct 9, 2009 at 10:55 AM, Georg Brandl wrote: > Hi, > > I want to make a plot with ordinary subplots, each of which has a > second axes set created with twinx().  Now, the second axes are > always drawn over the first, but I want the "main" data, which is > associated with the left Y axis,

Re: [Matplotlib-users] Draw twin axes below main axes

2009-10-12 Thread Georg Brandl
Jae-Joon Lee schrieb: > On Fri, Oct 9, 2009 at 10:55 AM, Georg Brandl > wrote: >> Hi, >> >> I want to make a plot with ordinary subplots, each of which has a >> second axes set created with twinx(). Now, the second axes are >> always drawn over the first, but I want the "main" data, which is >>