[Matplotlib-users] Find the RMS from a PSD

2011-01-24 Thread E
Hello matplotlib users.

I'm new to signal processing and I've read that RMS could be found from
a PSD. I'm interested in as I would further like to know energy in a
signal through it's frequencies.
My problem is I don't find how to calculate the RMS from the PSD output.
It seems it's a matter of scale (frequencies bandwith is taken in
account already).

I wrote a test case with a simple sinus. I should be able to find the
same RMS value from the PSD method and direct RMS over signal method.

Could you please have a look and tell me how to find good RMS value from
PSD output?

Thanks

#!/usr/bin/python
# -*- coding: utf-8 -*-

import matplotlib, platform
if platform.system() == 'Linux' :
matplotlib.use("gtk")
import pylab
import scipy



## PSD vs RMS

#Parameters
samplerate = 48000
nfft = 1024*2
graph = False

#create 1 sec sinus signal
t = scipy.arange(0, 1 , 1/float(samplerate))
signal = .25*scipy.sin(2*scipy.pi*(samplerate/10.)*t)
print len(signal)


#RMS of an array
def RMS(data):
rms = data**2
rms = scipy.sqrt(rms.sum()/len(data))
return rms

#PSD of an array. I want this to return the RMS
def RMSfromPSD(data) :
y, x = pylab.psd(data, NFFT = nfft, Fs = samplerate)

##Calculate the RMS

#The energy returned by PSD depends on FFT size
freqbandwith = x[1]
y = y*freqbandwith

#The energy returned by PSD depends on Samplerate
y = y/float(samplerate)

#Summing the power in freq domain to get RMS
rms =  scipy.sqrt(y.sum())

return rms

print "RMS method", RMS(signal)
print "RMS using PSD method", RMSfromPSD(signal)



#Graph
if graph == True :
pylab.subplot(211)
pylab.plot(t,signal)
pylab.subplot(212)
pylab.psd(signal, nfft, samplerate)
pylab.show()
--
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Find the RMS from a PSD

2011-01-25 Thread E
I think this was a bug in the PSD function in matplotlib 0.98.1 (Debian
lenny). This was making me crazy.
I took newer source code of this function from the project and all is
going well.

So to get the RMS power from PSD :

y, x = pylab.psd(data, NFFT = nfft, Fs = samplerate)
freqbandwith = x[1]
y = y*freqbandwith
rms =  scipy.sqrt(y.sum())

It should be the same as :

rms = data**2
rms = scipy.sqrt(rms.sum()/len(data))
--
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] building matplotlib 1.3 on OS X 10.8.4

2013-08-23 Thread Russell E. Owen
In article ,
 James Boyle  
 wrote:

> I built MPL 1.3 from source, all seem to go OK but I ran into the problem of 
> not finding libfreetype.6.dylib when importing.

Hmmm, it works for me. (I tried it again, just now). Here is what I did:

* Make sure you have XQuartz installed. I have 2.7.4 which I got from 
Apple.

* Edit setupext.py. Change this line:
 'darwin': ['/usr/local/', '/usr', '/usr/X11', '/opt/local'],
to:
'darwin': ['/usr', '/usr/X11'],
to avoid any conflicts with any extra software you might have installed.

* Copy setup.cfg.template to setup.cfg to change:
#backend = TkAgg
to:
backend = TkAgg

* python setup.py build
* python setup.py install

I found this resulted in a matplotlib I could use just fine on 10.8. (It 
won't work on 10.6 because the X11 libraries are in the wrong place).

-- Russell


--
Introducing Performance Central, a new site from SourceForge and 
AppDynamics. Performance Central is your source for news, insights, 
analysis and resources for efficient Application Performance Management. 
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Any progress on binary installer for OSX?

2013-10-03 Thread Russell E. Owen
In article 
,
 Matthew Brett  
 wrote:

> Hi,
> 
> On Thu, Oct 3, 2013 at 5:59 AM, Michael Droettboom 
>  wrote:
> > Matthew Terry, as part of his Mac testing project, has done a great deal of
> > reconnaissance on this.
> >
> > https://github.com/matplotlib/mpl_mac_testing
> >
> > I know he was looking into statically linking some of the C dependencies
> > (freetype, libpng etc.) as a way to make the installer more robust to
> > different environments.
> 
> Thanks - that looks like a useful testing grid.
> 
> Are there any near-term plans for something like a .dmg or .mpkg or
> .pkg installer?

Building a binary installer with statically linked libraries is not 
terribly hard (see 
). There are two problem:
- As of 1.3.0 mpl does not include python-dateutil, pytz or six (for 
good reasons) and that makes it harder to make a really usable binary 
installer. This interacts with the next problem:
- For unknown reasons running the 1.3.0 installer breaks existing 
installations of python-dateutil if those packages were installed using 
an older mpl binary installer.

The missing packages can be added to the binary installer after it is 
produced by bdist_mpkg by post-processing the mpkg. That would take care 
of the second issue for most users (who would use the default 
installation and get everything). I have not had time to deal with that. 
Thus I never uploaded an official binary installer for 1.3.0 and stopped 
providing them. Matthew Terry has taken over that task.

I did put an unofficial binary installer for 1.3.0 here:

just be prepared to reinstall python-dateutil after you use it.

-- Russell


--
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134791&iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Installation issue: python setup.py install --home=... fails

2013-11-22 Thread Russell E. Owen
In article <[email protected]>,
 Michael Droettboom  
 wrote:

> When you use |--home|, distutils assumes you are referring to a home 
> directory in which you have a tree of libraries in |lib|lib64| living 
> there, so it appends |lib64/python| to the given path:
> 
> |> python setup.py install --home=/foo
> running install
> Checking .pth file supportin  /foo/lib64/python/
> error: can't create or remove files in install directory|
> 
> So the issue is not that your PYTHONPATH doesn't contain 
> |/lsst/home/rowen/code/sandbox/Linux64/external/matplotlib/1.3.1+1| 
> (which it does) but that it doesn't contain 
> |/lsst/home/rowen/code/sandbox/Linux64/external/matplotlib/1.3.1+1/lib/python|
> |.
> 
> With matplotlib 1.2.1, we used raw distutils and not setuptools, which 
> does the same thing without the strict check.  And that does allow users 
> to shoot themselves in the foot, since the check is in fact right when 
> it says things won't work:
> 
> |> git checkout v1.2.1
> > mkdir ~/foo
> > python setup.py install --home=~/foo
> ...
> > PYTHONPATH=~/foo python
> Python2.7.5  (default, Oct8  2013,12:19:40)
> [GCC4.8.1  20130603  (Red Hat4.8.1-1)] on linux2
> Type"help","copyright","credits"  or  "license"  for  more information.
> >>>import  matplotlib
> Traceback (most recent call last):
>File"", line1,in  
> ImportError: No module named matplotlib|
> 
> I think what you really want to use is |--install-lib|, which will 
> install the matplotlib library directly inside of the given path, which 
> (if it's also on the `PYTHONPATH`) it will work.

Thank you. That did it!

For the record, we do actually want the files in /lib/python. So I 
fixed it by manually adding /lib/python to PYTHONPATH before 
running the installer.

It would help if the error message showed which path was expected to be 
on the PYTHONPATH, but now that I know I'm happy.

-- Russell


--
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing 
conversations that shape the rapidly evolving mobile landscape. Sign up now. 
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] figure.colorbar sometimes raises an exception

2013-11-22 Thread Russell E. Owen
We have code that ran fine in 1.1.1 that raises an exception in colorbar 
in 1.2.1 and 1.3.1. I have appended an example; I'm afraid it is rather 
extreme, but we have seen this for arrays that have more than one 
non-masked values as well, even with the values not all being equal.

Should I report this as a bug? Should we guard all our calls to colormap 
with try/except, or perhaps there's a flag we can set that says "do your 
best"? (But I don't see anything like that in the docs).

-- Russell

cmap = getattr(cm, cmap)
cmap.set_bad('k', 0.2)
if cmapOver is not None:
cmap.set_over(cmapOver, 1.0)
if cmapUnder is not None:
cmap.set_under(cmapUnder, 1.0)
p = PatchCollection(patches, norm=norm, cmap=cmap)
value_array = numpy.array(values)
masked_value_array = 
numpyMa.masked_where(numpy.isnan(value_array), value_array)
p.set_array(masked_value_array)
cb = self.fig.colorbar(p)

  File 
"/nfs/lsst/home/rowen/code/testing_pipeQA/python/lsst/testing/pipeQA/figu
res/FpaQaFigure.py", line 317, in makeFigure
cb = self.fig.colorbar(p)
  File 
"/lsst/DC3/stacks/gcc445-RH6/28nov2011/Linux64/external/matplotlib/1.3.1+
1/lib/python/matplotlib-1.3.1-py2.7-linux-x86_64.egg/matplotlib/figure.py
", line 1451, in colorbar
cb = cbar.colorbar_factory(cax, mappable, **kw)
  File 
"/lsst/DC3/stacks/gcc445-RH6/28nov2011/Linux64/external/matplotlib/1.3.1+
1/lib/python/matplotlib-1.3.1-py2.7-linux-x86_64.egg/matplotlib/colorbar.
py", line 1274, in colorbar_factory
cb = Colorbar(cax, mappable, **kwargs)
  File 
"/lsst/DC3/stacks/gcc445-RH6/28nov2011/Linux64/external/matplotlib/1.3.1+
1/lib/python/matplotlib-1.3.1-py2.7-linux-x86_64.egg/matplotlib/colorbar.
py", line 877, in __init__
ColorbarBase.__init__(self, ax, **kw)
  File 
"/lsst/DC3/stacks/gcc445-RH6/28nov2011/Linux64/external/matplotlib/1.3.1+
1/lib/python/matplotlib-1.3.1-py2.7-linux-x86_64.egg/matplotlib/colorbar.
py", line 317, in __init__
self.draw_all()
  File 
"/lsst/DC3/stacks/gcc445-RH6/28nov2011/Linux64/external/matplotlib/1.3.1+
1/lib/python/matplotlib-1.3.1-py2.7-linux-x86_64.egg/matplotlib/colorbar.
py", line 342, in draw_all
self._config_axes(X, Y)
  File 
"/lsst/DC3/stacks/gcc445-RH6/28nov2011/Linux64/external/matplotlib/1.3.1+
1/lib/python/matplotlib-1.3.1-py2.7-linux-x86_64.egg/matplotlib/colorbar.
py", line 433, in _config_axes
self.update_ticks()
  File 
"/lsst/DC3/stacks/gcc445-RH6/28nov2011/Linux64/external/matplotlib/1.3.1+
1/lib/python/matplotlib-1.3.1-py2.7-linux-x86_64.egg/matplotlib/colorbar.
py", line 367, in update_ticks
ticks, ticklabels, offset_string = self._ticker()
  File 
"/lsst/DC3/stacks/gcc445-RH6/28nov2011/Linux64/external/matplotlib/1.3.1+
1/lib/python/matplotlib-1.3.1-py2.7-linux-x86_64.egg/matplotlib/colorbar.
py", line 580, in _ticker
ticks = self._locate(b)
  File 
"/lsst/DC3/stacks/gcc445-RH6/28nov2011/Linux64/external/matplotlib/1.3.1+
1/lib/python/matplotlib-1.3.1-py2.7-linux-x86_64.egg/matplotlib/colorbar.
py", line 829, in _locate
z = np.take(y, i0) + (xn - np.take(b, i0)) * dy / db
FloatingPointError: invalid value encountered in divide

Where masked_value_array=[-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
-- -- -- -- -- -- -- -- -- --
 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
--
 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
--
 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
 0.7598040968345164 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
--
 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
--
 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
--]


--
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing 
conversations that shape the rapidly evolving mobile landscape. Sign up now. 
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] _tkinter problem

2009-07-08 Thread Russell E. Owen
Your python is missing the _tkinter library, so it cannot use Tkinter.

Normally if you build from source then all you have to do is build and 
install tcl and tk first, then build python and it should find the 
tcl/tk and build _tkinter (the library that links to Tcl/Tk and allows 
Tkinter to work).

If you installed from an RPM or some such then perhaps you need to get 
some additional RPMs.

If you have additional questions about installing python with Tkinter 
support I suggest you post to the python-tkinter mailing list 
(gmane.comp.python.tkinter on gmane).

-- Russell

In article <7483f0868d484ae6a0a7ddb5bfbfd...@newhome>,
 "Paul Simon"  wrote:

> I have the "tkinter" problem and need some assistance to straighten it out. 
> >From the web page "http://wiki.python.org/moin/TkInter"; I tested as in "step 
> 1" and cannot import "_tkinter." I do not have that file on my computer, but 
> do have tkinter.py in /usr/local/lib/python2.6/lib-tk. as well as the 
> directories /usr/lib/tk8.5 and /usr/lib/tcl8.5.
> This matplotlib and python stuff is great, but the documentation frequently 
> feels like it is just a bit out of my grasp. I realize that all of this is 
> free but I understand the instructions on the web page to repair only to the 
> point of confusion. I'm not an expert. How do I modify my python 
> configuration? Is there a file that needs to be edited? Which setup.py file 
> do I use? Make? or python setup.py build and python setup.py install?
> Thanks. I appreciate your help.
> Paul Simon 
> 
> 
> 
> --
> Enter the BlackBerry Developer Challenge  
> This is your chance to win up to $100,000 in prizes! For a limited time, 
> vendors submitting new applications to BlackBerry App World(TM) will have
> the opportunity to enter the BlackBerry Developer Challenge. See full prize  
> details at: http://p.sf.net/sfu/Challenge


--
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplotlib on mac os x question

2009-08-26 Thread Russell E. Owen
A few things:
- What python and matplotlib are you using? I recommend Mac Python from 
python.org (use the binary installer) and the Mac binary installer for 
matplotlib.

- Note that matplotlib 0.99.0 is current. I suggest you upgrade.

- If you are using TkAgg (as seems likely), I'm not sure how well it 
plays with IDLE. I suggest you try the same example from the command 
line (Terminal application).

- What is your default backend? The normal Mac binary matplotlib uses 
TkAgg, which is a good choice in this case. But if you build from source 
the default is Agg, which is probably not what you want. You can set the 
default explicitly by editing .matplotlib/matplotlibrc (which has 
probably appeared now that you've run matplotlib once).

Here's a slightly shorter example (I confess I'm not familiar with 
matplotlib.pyplot so I hope this is not deprecated):
import pylab
pylab.plot([1, 2, 3])
pylab.show()

-- Russell

In article <[email protected]>,
 Walid Majid  wrote:

> Hi,
> 
> I am new to matplotlib and having trouble running a simple example, which I 
> found on one of the tutorial pages:
> 
> import matplotlib.pyplot as plt
> plt.plot([1,2,3])
> plt.ylabel('some numbers')
> plt.show()
> 
> The problem I encounter is that no plot actually shows up when I run the 
> above sequence on my idle session. 
> I am running on Mac OS X 10.5.6 and if anyone can give me some help, I would 
> appreciate it.  
> 
> Python: 2.5.4
> idle: 1.2.4
> matplotlib: 0.98.5.3
> 
> WM


--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] resolution issues

2010-02-23 Thread Tornes, Ivan E
We have a very large data set that we are trying to plot in matplotlib.  We 
found that when you have multiple data points per pixel the backend does not 
always pick the point with the largest value to draw.  If you resize the plot 
window it changes what is being shown on the figure.   Narrow features of the 
curve vary in amplitude on resize of the plot window.  Is there a built in 
solution to fix this?

Ivan E. Tornes Ph.D.
Battelle
505 King Avenue
Columbus, OH 43201-2693

Phone:614-424-5165
Fax:614-458-5165

--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Agg complexity exceeded

2010-03-12 Thread Tornes, Ivan E
I'm working on a project that handles large data sets.  Up to this point I had 
not had any issues using matplotlib, but I tried yesterday to have it plot a 
file that had 8 million float,float pairs in it and dies with the following 
message:

pException in Tkinter callback
Traceback (most recent call last):
  File "/usr/lib/python2.6/lib-tk/Tkinter.py", line 1413, in __call__
return self.func(*args)
  File "/usr/lib/pymodules/python2.6/matplotlib/backends/backend_tkagg.py", 
line 212, in resize
self.show()
  File "/usr/lib/pymodules/python2.6/matplotlib/backends/backend_tkagg.py", 
line 215, in draw
FigureCanvasAgg.draw(self)
  File "/usr/lib/pymodules/python2.6/matplotlib/backends/backend_agg.py", line 
314, in draw
self.figure.draw(self.renderer)
  File "/usr/lib/pymodules/python2.6/matplotlib/artist.py", line 46, in 
draw_wrapper
draw(artist, renderer, *kl)
  File "/usr/lib/pymodules/python2.6/matplotlib/figure.py", line 774, in draw
for a in self.axes: a.draw(renderer)
  File "/usr/lib/pymodules/python2.6/matplotlib/artist.py", line 46, in 
draw_wrapper
draw(artist, renderer, *kl)
  File "/usr/lib/pymodules/python2.6/matplotlib/axes.py", line 1721, in draw
a.draw(renderer)
  File "/usr/lib/pymodules/python2.6/matplotlib/artist.py", line 46, in 
draw_wrapper
draw(artist, renderer, *kl)
  File "/usr/lib/pymodules/python2.6/matplotlib/lines.py", line 535, in draw
drawFunc(renderer, gc, tpath, affine.frozen())
  File "/usr/lib/pymodules/python2.6/matplotlib/lines.py", line 874, in 
_draw_lines
self._lineFunc(renderer, gc, path, trans)
  File "/usr/lib/pymodules/python2.6/matplotlib/lines.py", line 918, in 
_draw_solid
renderer.draw_path(gc, path, trans)
  File "/usr/lib/pymodules/python2.6/matplotlib/backends/backend_agg.py", line 
98, in draw_path
self._renderer.draw_path(gc, path, transform, rgbFace)
RuntimeError: Agg rendering complexity exceeded. Consider downsampling or 
decimating your data.

I would prefer to not decimate my data if possible.

Ivan E. Tornes

--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] What would you like to see in a book about Matplotlib?

2009-01-05 Thread Russell E. Owen
In article 
<[email protected]>,
 "Sandro Tosi"  wrote:

> Hello and Happy 2009!
> 
> I received the interesting proposal to author a book on Matplotlib,
> the powerful 2D plotting library for Python.
> 
> While preparing the arguments list, I'd like to hear even your
> opinion, because different points-of-view will lead to a better
> product.
> 
> Some basic question I'd like to ask are:
> 
> - what are you using matplotlib for?

Plotting data from a networked Tkinter application.

> - what are the (basic) things that, when you were beginning to use
> matplotlib, you wanted to see grouped up but couldn't find?
> - what would you like to see in a book about matplotlib?

I want a user's guide for the class API. So far I've figured it out by 
reading examples, trying to extrapolate from the pylab user's guide 
(which is quite good) and reading the class API reference, but I feel 
that I barely understand what I am doing.

> - what are the things you'd like to explore of matplotlib and never
> had time to do?

I'd like to know how best to handle plotting data as it arrives (e.g. 
strip charts and evolving x-y plots). I've got code that works but am 
not convinced I'm doing it in the best fashion.

Histograms.

-- Russell


--
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Warning from pylab.plot on Linux

2009-03-31 Thread David E. Sigeti

Dear Mike and Jouni,

Since my post from yesterday, I have discovered that I was using the 
WXApp backend and that using the TkApp backend fixed the problem.


Thanks for the help and sorry about the naive question.  I am almost 
completely new to Matplotlib and am only now getting my bearings.


That said, I have another question: Are there any important 
implications to the spurious warnings coming from WXApp?  I don't 
know how functional WXApp is expected to be at this point nor even if 
this problem really precludes using it.  For all I know there might 
be a simple work-around or there might really be no reason at all to 
use WXApp rather than TkApp.  Any light that you can shed here would 
be much appreciated.


A couple of further observations:
   * As I pointed out, pyplot.show appears to work fine in spite of 
the warning message.  The resulting plot window, however, shows a 
number of peculiarities in behavior and seems to be missing 
functionality that the corresponding TkApp window has.  All this 
suggests to me that the WXApp backend may not really be fully 
functional yet.  Any  observations or comments?
   * wxPython itself seems to work fine.  At least, that is what I 
see from running the demos.
Again, thanks for the help and any further comments, observations, 
advice will be much appreciated.


Yours,
David

At 08:41 AM 3/31/2009, Michael Droettboom wrote:
Which backend are you using? I suspect this is actually a bug in the 
GUI framework being used, which we could rule out by running a 
simple script to do something basic (like show a window) and see if 
we get the same warning.


Mike

sigeti wrote:

Dear Matplotlib Folks,

When I run pylab.plot, I get a weird warning:

** (python:20754): WARNING **: Couldn't connect to system bus

** (python:20754): WARNING **: Couldn't connect to system bus


(Note that this was copied by hand because the system on which I run
Matplotlib is currently unable to connect to the global internet.)

The first line really is repeated.

The number after "python:" changes from one instance of the warning to
another.

I am running:

Red Hat Enterprise Linux ES release 4 (Nahant Update 3)

At least, that is what is in /etc/redhat-release.

The warning is not fatal and I can display what I attempted to plot with
pylab.show.  However, the warning has a significant impact on the
interactive usability of Python and matplotlib as a replacement for Matlab.

Anyone have any suggestions or observations?

Yours,
David Sigeti



--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA



---
Dr. David E. Sigeti
Phone:  505-667-9239
E-mail: [email protected]
Surface mail: MS-F644, Los Alamos National Laboratory,
  Los Alamos, NM  87545   USA
--
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Warning from pylab.plot on Linux

2009-03-31 Thread David E. Sigeti

Friends,

Oops!  "WXAgg" and "TkAgg" rather than "WXApp" and "TkApp", of 
course.  I did say that I was just getting my bearings.


Yours,
David

At 12:13 PM 3/31/2009, David E. Sigeti wrote:

Dear Mike and Jouni,

Since my post from yesterday, I have discovered that I was using the 
WXApp backend and that using the TkApp backend fixed the problem.


Thanks for the help and sorry about the naive question.  I am almost 
completely new to Matplotlib and am only now getting my bearings.


That said, I have another question: Are there any important 
implications to the spurious warnings coming from WXApp?  I don't 
know how functional WXApp is expected to be at this point nor even 
if this problem really precludes using it.  For all I know there 
might be a simple work-around or there might really be no reason at 
all to use WXApp rather than TkApp.  Any light that you can shed 
here would be much appreciated.


A couple of further observations:
   * As I pointed out, pyplot.show appears to work fine in spite of 
the warning message.  The resulting plot window, however, shows a 
number of peculiarities in behavior and seems to be missing 
functionality that the corresponding TkApp window has.  All this 
suggests to me that the WXApp backend may not really be fully 
functional yet.  Any  observations or comments?
   * wxPython itself seems to work fine.  At least, that is what I 
see from running the demos.
Again, thanks for the help and any further comments, observations, 
advice will be much appreciated.


Yours,
David

At 08:41 AM 3/31/2009, Michael Droettboom wrote:
Which backend are you using? I suspect this is actually a bug in 
the GUI framework being used, which we could rule out by running a 
simple script to do something basic (like show a window) and see if 
we get the same warning.


Mike

sigeti wrote:

Dear Matplotlib Folks,

When I run pylab.plot, I get a weird warning:

** (python:20754): WARNING **: Couldn't connect to system bus

** (python:20754): WARNING **: Couldn't connect to system bus


(Note that this was copied by hand because the system on which I run
Matplotlib is currently unable to connect to the global internet.)

The first line really is repeated.

The number after "python:" changes from one instance of the warning to
another.

I am running:

Red Hat Enterprise Linux ES release 4 (Nahant Update 3)

At least, that is what is in /etc/redhat-release.

The warning is not fatal and I can display what I attempted to plot with
pylab.show.  However, the warning has a significant impact on the
interactive usability of Python and matplotlib as a replacement for Matlab.

Anyone have any suggestions or observations?

Yours,
David Sigeti



--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA


---
Dr. David E. Sigeti
Phone:  505-667-9239
E-mail: [email protected]
Surface mail: MS-F644, Los Alamos National Laboratory,
  Los Alamos, NM  87545   USA



---
Dr. David E. Sigeti
Phone:  505-667-9239
E-mail: [email protected]
Surface mail: MS-F644, Los Alamos National Laboratory,
  Los Alamos, NM  87545   USA
--
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Problem building 64-bit matplotlib for MacOS X 10.6

2011-10-11 Thread Russell E. Owen
I was hoping to build a matplotlib binary installer for python.org's 
64-bit Python (MacOS X 10.6 and later). But I've run into problems that 
make me think python.org's python is not fully compatible with 
ActiveState Tcl/Tk.

Here's what I have:
MacOS X 10.6.8
Python: python-2.7.2-macosx10.6.dmg
Tcl/TK: ActiveTcl8.5.10.1.295062-macosx10.5-i386-x86_64-threaded.dmg
XCode 3.2.6
matplotlib 1.1.0

I edited setupext.py in the matplotlib source directory to set darwin to:
   'darwin' : ['/usr', '/usr/X11'],
The idea was to use only Apple's own libraries for the dependencies.
I did not install wxPython because, as I understand it, there is no 
64-bit version.

matplotlib seems to build OK (see appended log) though there are 
disturbing messages such as these:
i686-apple-darwin10-gcc-4.2.1: -framework: linker input file unused 
because linking not done
i686-apple-darwin10-gcc-4.2.1: Tcl: linker input file unused because 
linking not done

I can import and run Tkinter, though I've not done anything beyond 
putting up a root window.

But when I try to import pylab I get:
objc[1083]: Class TKApplication is implemented in both 
/Library/Frameworks/Tk.framework/Versions/8.5/Tk and 
/System/Library/Frameworks/Tk.framework/Versions/8.5/Tk. One of the two 
will be used. Which one is undefined.
objc[1083]: Class TKMenu is implemented in both 
/Library/Frameworks/Tk.framework/Versions/8.5/Tk and 
/System/Library/Frameworks/Tk.framework/Versions/8.5/Tk. One of the two 
will be used. Which one is undefined.
objc[1083]: Class TKContentView is implemented in both 
/Library/Frameworks/Tk.framework/Versions/8.5/Tk and 
/System/Library/Frameworks/Tk.framework/Versions/8.5/Tk. One of the two 
will be used. Which one is undefined.
objc[1083]: Class TKWindow is implemented in both 
/Library/Frameworks/Tk.framework/Versions/8.5/Tk and 
/System/Library/Frameworks/Tk.framework/Versions/8.5/Tk. One of the two 
will be used. Which one is undefined.

Any idea how to deal with this? I've never seen this before and google 
was no help. Others have seen this problem but I saw no solution.

-- Russell

P.S. partial log of build (not install) of matplotlib:

BUILDING MATPLOTLIB
   matplotlib: 1.1.0
   python: 2.7.2 (v2.7.2:8527427914a2, Jun 11 2011, 15:22:34)
   [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)]
 platform: darwin

REQUIRED DEPENDENCIES
numpy: 1.6.1
freetype2: found, but unknown version (no pkg-config)

OPTIONAL BACKEND DEPENDENCIES
   libpng: found, but unknown version (no pkg-config)
  Tkinter: Tkinter: version not identified, Tk: 8.5, Tcl: 8.5
 Gtk+: no
   * Building for Gtk+ requires pygtk; you must be 
able
   * to "import gtk" in your build/install 
environment
  Mac OS X native: yes
   Qt: no
  Qt4: no
Cairo: no

OPTIONAL DATE/TIMEZONE DEPENDENCIES
 datetime: present, version unknown
 dateutil: matplotlib will provide
 pytz: matplotlib will provide
adding pytz

OPTIONAL USETEX DEPENDENCIES
   dvipng: no
  ghostscript: /bin/sh: gs: command not found
latex: no

[Edit setup.cfg to suppress the above messages]
=
===
pymods ['pylab']
packages ['matplotlib', 'matplotlib.backends', 
'matplotlib.backends.qt4_editor', 'matplotlib.projections', 
'matplotlib.testing', 'matplotlib.testing.jpl_units', 
'matplotlib.tests', 'mpl_toolkits', 'mpl_toolkits.mplot3d', 
'mpl_toolkits.axes_grid', 'mpl_toolkits.axes_grid1', 
'mpl_toolkits.axisartist', 'matplotlib.sphinxext', 'matplotlib.tri', 
'matplotlib.delaunay', 'pytz', 'dateutil', 'dateutil.zoneinfo']
running build
running build_py
...
gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -isysroot 
/Developer/SDKs/MacOSX10.6.sdk -arch i386 -arch x86_64 -g -O2 -DNDEBUG 
-g -O3 -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API -DPYCXX_ISO_CPP_LIB=1 
-I/Library/Frameworks/Tcl.framework/Headers 
-I/Library/Frameworks/Tcl.framework/Versions/Current/PrivateHeaders 
-I/Library/Frameworks/Tk.framework/Headers 
-I/Library/Frameworks/Tk.framework/Versions/Current/PrivateHeaders 
-I/usr/include -I/usr/X11/include -I. 
-I/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-pa
ckages/numpy/core/include -Isrc -Iagg24/include -I. 
-I/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-pa
ckages/numpy/core/include -I/usr/include -I/usr/X11/include -I. 
-I/Library/Frameworks/Tcl.framework/Headers/freetype2 
-I/Library/Frameworks/Tcl.framework/Versions/Current/PrivateHeaders/freet
ype2 -I/Library/Frameworks/Tk.framework/Headers/freetype2 
-I/Library/Frameworks/Tk.framework/Versions/Current/PrivateHeaders/freety
pe2 -I/usr/include/freetype2 -I/usr/X11/include/freetype2 -I./freetype2 
-I/Library/Frameworks/Python.framework/Versions/2.7/lib/pyth

Re: [Matplotlib-users] Matplotlib "show()" error Mac OS X Lion

2011-11-09 Thread Russell E. Owen
In article <[email protected]>,
 Bedartha Goswami  
 wrote:

> Hi,
> 
> I have recently installed Python 32/64bit from Python.org and then I 
> proceeded to install bumpy, scipy, matplotlib and igraph on it. But the 
> Matplotlib does not show the plots even if it opens a Figure window. Here is 
> a summary of what I had done in my installation:
> -
> I first did a "clean install" by following the instructions at (with an idea 
> to reinstall Matplotlib and see if the rror repeats):
> http://matplotlib.sourceforge.net/faq/installing_faq.html#clean-install
> -
> So now my python does not have matplotlib:
> 
> Bedarthas-MacBook-Air:~ bedartha$ cd ~/Desktop/
> Bedarthas-MacBook-Air:Desktop bedartha$ python
> Python 2.7.2 (v2.7.2:8527427914a2, Jun 11 2011, 15:22:34) 
> [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import matplotlib
> Traceback (most recent call last):
>   File "", line 1, in 
> ImportError: No module named matplotlib
> >>> 
> Bedarthas-MacBook-Air:Desktop bedartha$
> -
> Then I downloaded (again) the DMG file at: 
> http://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-1.1.0/m
> atplotlib-1.1.0-py2.7-python.org-macosx10.3.dmg/download
> -
> and installed Matplotlib (which seems to go through fine). But after that:
> 
> Bedarthas-MacBook-Air:~ bedartha$ cd ~/Desktop/
> Bedarthas-MacBook-Air:Desktop bedartha$ python
> Python 2.7.2 (v2.7.2:8527427914a2, Jun 11 2011, 15:22:34) 
> [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin

I suspect you are trying to install matplotlib on the 64-bit Python 
instead of the 32-bit python for which it was built

I say this because 32-bit python is built using GCC 4.0.1.

There is no matplotlib binary for 64-bit Python yet because I've not 
figured out how to build one successfully -- I get horrible conflicts 
with Tcl/Tk.

-- Russell


--
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Matplotlib "show()" error Mac OS X Lion

2011-11-10 Thread Russell E. Owen
In article 
<[email protected]>,
 Michiel de Hoon  
 wrote:

> --- On Wed, 11/9/11, Russell E. Owen  
> wrote:
> > There is no matplotlib binary for 64-bit Python yet because
> > I've not 
> > figured out how to build one successfully -- I get horrible
> > conflicts 
> > with Tcl/Tk.
> > 
> Would it be possible to release a matplotlib binary for 64-bit Python using 
> the MacOSX backend instead of tkagg?

It's not hard to build your own 64-bit matplotlib on 10.6 (and I assume 
the instructions are the same on 10.7, but perhaps not). The 
prerequisite libraries are already present. Just make sure you have the 
following installed:
- XCode with gcc 4.2 as the default compiler (one way to change the 
default is using a pair of symlinks in /usr/bin or /usr/local/bin -- one 
for gcc, one for g++)
- Python.org's 64-bit python installed and preferably running as the 
default.

Download and unpack the matplotlib source.
Edit setupext.py and change the entry for darwin to include those two 
directories: /usr/X11 and /usr/lib. 

Then copy setup.cfg.template to setup.cfg and edit setup.cfg to enable 
the backends you want. Be sure to disable TkAgg because it won't build 
properly.

Then build in the usual way:
python setup.py build
python setup.py install

I personally don't think the matplotlib project should serve such a 
product unless and until somebody has time to deal with the Tk linking 
issues, which apparently require editing some resulting libraries (more 
than I want to attempt). But that's just my opinion.

-- Russell


--
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplotlib install on mac osx 10.6.8

2012-02-14 Thread Russell E. Owen
In article <[email protected]>,
 "Full Name" <[email protected]> wrote:

> Hello,
> 
> Mac OSX 10.6.8
> matplotlib 1.1.0
> 
> 
> From the matplotlib website:
> =
> Installing OSX binaries
> If you want to install matplotlib from one of the binary installers we build, 
> you have two choices: a mpkg installer, which is a typical Installer.app, or 
> a binary OSX egg, which you can install via setuptools’ easy_install.
> 
> The mkpg installer will have a “zip” extension, and will have a name like 
> matplotlib-0.99.0.rc1-py2.5-macosx10.5_mpkg.zip. 
> ==
> 
> Where are those files?  I can't find them anywhere.
> 
> Also from the matplotlib website:
> ===
> You can also use the eggs we build for OSX (see the installation instructions 
> for easy_install if you do not have it on your system already). You can try:
> 
> > easy_install matplotlib
> which should grab the latest egg from the sourceforge site, but sometimes the 
> naming conventions for OSX eggs can be broken (see below). Therefore, there 
> is no guarantee the right egg will be found. We recommend you download the 
> latest egg from our download site directly to your harddrive, and manually 
> install it, eg:
> 
> > easy_install --install-dir=~/dev/lib/python2.5/site-packages/  
> > matplotlib-0.99.0.rc1-py2.5-macosx-10.5-i386.egg
> ===
> 
> Where are those eggs?  I can't find them anywhere.
> 
> On the home page of the matplotlib website, on the right hand side, is a link 
> "downloads", which took me here:
> 
> http://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-1.1.0/
> 
> There isn't anything later than osx 10.3 there, and there are no egg files at 
> all.  Yet the install directions mention osx10.5. 
> 
> I installed python 2.7, which automatically installed an interpreter named 
> python2.7, because the Numpy installer I found was for python 2.7 and mac osx 
> 10.6. I installed this for matplotlib:
> 
> matplotlib-1.1.0-py2.7-python.org-macosx10.3.dmg
>...

There are no Mac eggs for the current version of matplotlib. The 
references to them are obsolete.

The file you found is the only option for MacOS X (presently). It 
requires python.org's 32-bit Python 2.7, which is for MacOS X 10.3.9 and 
later.

I just built an installer for python.org's 64-bit Python 2.7, which 
requires MacOS X 10.6 and after a bit of testing I'll serve that.

-- Russell


--
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] 64-bit matplotlib 1.1.0 installer available

2012-02-14 Thread Russell E. Owen
I just created a binary installer for python.org's 64-bit Python 2.7 
(MacOS X 10.6 and later). I'd like a few folks to test it to make sure 
it works for more than just me, before serving it at the usual location.

The temporary link is:


Thanks to Ned Deily for providing the fix. It turned out to be a known 
bug in XCode 3.2.6 -- an incorrect symlink -- as described here 
(including the fix):

once I fixed that the normal matplotlib build worked perfectly
after editing setupext.py to set:
   'darwin': ['/usr/local', '/usr/', '/usr/X11'],

I recommend that as the default value in future releases of matplotlib 
because:
- It works if using python.org python or Apple's Python
- If one is using macports or other such package managers then 
matplotlib is probably already available -- folks are less likely to 
build from source.

-- Russell


--
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplotlib install on mac osx 10.6.8

2012-02-15 Thread Russell E. Owen
In article ,
 7stud <[email protected]> wrote:

> Since my op, I also tried to download:
> 
> matplotlib-1.1.0.tar.gz
> 
> and I got a Decompression Failed message in the Downloads window.  
> I checked my Safari settings, and 
> Safari is set to automatically decompress 'safe' files.  
>  guess it couldn't in the case of matplotlib.
> 
> Next, I tried decompressing and untaring myself:
>...
> So it seems to me like the tar.gz file at sourceforge is corrupted.

Very odd. I'm on MacOS X 10.6.8 and I am able to download it and 
uncompress it just fine. I double click it and BOM helper handles it 
just fine.

You might try reinstalling your operating system from a combo updater, 
or try BetterZip (which I own so I can easily make .zip and .tgz files 
with no Mac-specific content).

-- Russell


--
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] 64-bit matplotlib 1.1.0 installer available

2012-02-15 Thread Russell E. Owen
In article ,
 7stud <[email protected]> wrote:

> Russell E. Owen  writes:
> 
> > 
> > I just created a binary installer for python.org's 64-bit Python 2.7 
> > (MacOS X 10.6 and later). I'd like a few folks to test it to make sure 
> > it works for more than just me, before serving it at the usual 
> > location.
> > 
> 
> I can report that your installer has enabled me to successfully 
> execute the following two progams:...

Thank you for testing it. I have uploaded the installer to sourceforge.

-- Russell


--
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Question(s) for new MAC 10.7 User

2012-02-28 Thread Russell E. Owen
In article 
,
 William Jennings  
 wrote:

>  Hello mat plot lib users!
> I feel quite embarrassed that I've gone through 2 days of trying to get to
> get numpy, scipy and matplotlib all to work nice with each other. I've
> scraped through forums, stackoverflow and all the links that can bide me
> some type of logic. Yet, alas I still fail wildly with this set of errors:
> 
> *my current status is: just did a fresh install of my lion os and haven't
> installed Xcode yet. I'm a little lost and have found only macports,
> homebrew guides online only to be a slower failure. I really need to use
> this software but I'm finding it difficult keeping straight what order and
> what I need to install. 

I recommend:
- Install python.org 64-bit Python 2.7 (the one labelled as being for 
MacOS X 10.6 and later)
- Install numpy, scipy and matplotlib Mac binary with "macosx10.6" in 
their names. These are available from the web sites maintained by those 
projects.

Or if you want better backward compatibility (e.g. if you plan to 
distribute applications) then instead you should use the 32-bit 
python.org python (marked as for MacOS X 10.3 and later) and the numpy, 
scipy and matplotlib Mac binary installers with "macosx10.3" in their 
names.

-- Russell


--
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Question(s) for new MAC 10.7 User

2012-03-01 Thread Russell E. Owen
In article ,
 "Russell E. Owen"  wrote:

> In article 
>  blic.gmane.org>,
>  William Jennings  
>  wrote:
> 
> >  Hello mat plot lib users!
> > I feel quite embarrassed that I've gone through 2 days of trying to get to
> > get numpy, scipy and matplotlib all to work nice with each other. I've
> > scraped through forums, stackoverflow and all the links that can bide me
> > some type of logic. Yet, alas I still fail wildly with this set of errors:
> > 
> > *my current status is: just did a fresh install of my lion os and haven't
> > installed Xcode yet. I'm a little lost and have found only macports,
> > homebrew guides online only to be a slower failure. I really need to use
> > this software but I'm finding it difficult keeping straight what order and
> > what I need to install. 
> 
> I recommend:
> - Install python.org 64-bit Python 2.7 (the one labelled as being for 
> MacOS X 10.6 and later)
> - Install numpy, scipy and matplotlib Mac binary with "macosx10.6" in 
> their names. These are available from the web sites maintained by those 
> projects.
> 
> Or if you want better backward compatibility (e.g. if you plan to 
> distribute applications) then instead you should use the 32-bit 
> python.org python (marked as for MacOS X 10.3 and later) and the numpy, 
> scipy and matplotlib Mac binary installers with "macosx10.3" in their 
> names.

This sort of thing comes up often enough that I've posted a web page on 
the topic, including reasons you might want to choose 32-bit or 64-bit:
<http://www.astro.washington.edu/users/rowen/MacBinaryPythonPackageInstal
lers.html>

-- Russell


--
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Having trouble installing matplotlib on Mac OS X Lion

2012-04-05 Thread Russell E. Owen
In article ,
 Bill Carithers  wrote:

> Hi all,
> 
> I had matplotlib-0.99.1.1 working with Python 2.6 on OS X v10.6(Snow
> Leopard). Today I upgraded to Lion (v10.7) and matplotlib had disappeared.
> Lion ships with Apple¹s version of Python 2.7. Even when I look back at
> Python 2.6 in the /System/Library/Frameworks/Python/Version/Python2.6, it
> seems to be gone. OK, I thought I would install matplotlib-1.0.1 in Python
> 2.7 using easy_install. It failed when unable to find the headers for numpy
> (terminal output below). Lion comes with numpy 1.5.1 pre-installed. I tried
> re-installing numpy but that didn¹t help so now I¹m stuck.
> 
> Any suggestions?

I personally would not try to mess with Apple's python. It's safer to 
leave it alone, and it is not upgrade very often.

My personal favorite option:
- install python.org's python
- install the official binary installers for numpy and matplotlib (both 
of which assume python.org's python)

You can use other standard distributions of Python including:
- fink
- MacPorts
- Enthought's python distribution
most or all of these come with their own versions of numpy and 
matplotlib (though in the case of fink and MacPorts you have to 
explicitly install them).

-- Russell


--
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplotlib for Mac OS 10.7 (Lion)

2012-04-23 Thread Russell E. Owen
In article 
,
 C M  wrote:

> Trying to help a Mac friend running OSX 10.7 (Lion) easily set up to test
> scripts I send him, and have some questions:
> 
> 1) Can Matplotlib 1.1 run on the Python 2.7.2 version that comes with
> Lion?

Yes. You can easily build it yoursef as long as you have XCode 
installed: 

- Edit setupext.py so that the list of values for "darwin" is 
['/usr/local', '/usr', /usr/X11']
(and for a really vanilla build leave out /usr/local). (I have a pull 
request for this to be part of the standard distro, but I don't know if 
or when it will go in since not a big issue.)

Then do the usual:
% python setup.py build
% sudo python setup.py install

> 2) When is there expected to be an installer for Matplotlib 1.1 for OSX
> 10.7?

There is one, but like all the matplotlib (and numpy and scipy) official 
binaries it uses python.org's python, not Apple's.

To go this route install python.org's Python 2.7.2 for 10.6-and-later 
(which is 64-bit) and then install the official numpy and matpotlib 
binaries.

(It is a bit of a hassle to have to install a different python, but it 
has the advantage that you can freely upgrade python itself and packages 
without fear of breaking anything in the operating system.)

There are lots of other options: Enthought has a python installer that 
includes lots of useful scientific packages. ActiveState has an 
installer with a lot of packages available (though last I checked 
matplotlib was out of date, which quite surprised me). MacPorts and 
competing package managers make it easy to install packages.

Regards,

-- Russell


--
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplotlib for Mac OS 10.7 (Lion)

2012-04-24 Thread Russell E. Owen
In article 
,
 C M  wrote:

> > > Trying to help a Mac friend running OSX 10.7 (Lion) easily set up to test
> > > scripts I send him, and have some questions:
> > >
> > > 1) Can Matplotlib 1.1 run on the Python 2.7.2 version that comes with
> > > Lion?
> >
> > Yes. You can easily build it yoursef as long as you have XCode
> > installed:
> >
> > - Edit setupext.py so that the list of values for "darwin" is
> > ['/usr/local', '/usr', /usr/X11']
> > (and for a really vanilla build leave out /usr/local). (I have a pull
> > request for this to be part of the standard distro, but I don't know if
> > or when it will go in since not a big issue.)
> >
> > Then do the usual:
> > % python setup.py build
> > % sudo python setup.py install
> 
> Where are you getting matplotlib 1.1 for Mac OSX 10.7 from to build it?

1.1.0 is the current release. I downloaded the unix tarball.

> > > 2) When is there expected to be an installer for Matplotlib 1.1 for OSX
> > > 10.7?
> >
> > There is one, but like all the matplotlib (and numpy and scipy) official
> > binaries it uses python.org's python, not Apple's.
> >
> > To go this route install python.org's Python 2.7.2 for 10.6-and-later
> > (which is 64-bit) and then install the official numpy and matpotlib
> > binaries.
> 
> >From where?  I didn't see it.  I am talking about having a binary
> installer on the Matplotlib downloads page,,. the last one I see there
> is this, which is for OSX-10.6:
> 
> matplotlib-1.1.0-py2.7-python.org-macosx10.6.dmg2012-02-15

That is the one. 10.6 means "10.6 and later". It is build for 
python.org's Mac binary installer for 10.6 and later, which works just 
fine on Lion.

-- Russell


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] installing matplotlib on mac os X with the *.dmg file

2012-08-31 Thread Russell E. Owen
In article <[email protected]>,
 Felix Patzelt 
  wrote:

> The dmg you are referring to appears to install to 
> /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages 
> (The main library, not the one for in our user directory). Most likely, this 
> directory is not in pythons search path.

python.org python installs into /Library/Frameworks/Python.framework
and its main site-packages directory is the line listed above.

That is where *all* packages get installed by default (e.g. by distutils 
or pip).

I suspect the original poster has a conflict with another version of 
python or another package management system such as homebrew. You can 
verify which python is running using "which python" (it should be 
/usr/local/bin/python, which is a symlink to a binary in 
/Library/Frameworks/Python.framework,
or the actual binary itself, depending on your $PATH.

One can test matplotlib using:
python -c "import matplotlib as m ; m.test(verbosity=1)"

If that works then I suspect ipython is misinstalled.

-- Russell


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplotlib 1.2.0 (OS X 10.6 binary) "requires System Python 2.7"

2012-11-13 Thread Russell E. Owen
In article 
,
 Alexey Shamrin  
 wrote:

> Thank you for 1.2.0 release!
> 
> Could you please make it clear that matplotlib requires
> python.org-Python sourceforge.net-NumPy? Telling about it during
> installation would be great.

This is described in three places:
- The description of the file on the download page
- The name of the file on the download page
- The ReadMe file in the binary installer

Note that the official binary installers for numpy and scipy are also 
for python.org python, and as far as I know they do no more than the 
matplotlib installer as far as informing the user of this fact.

It is bdist_mpkg that makes these installers, and it could be better 
about checking compatibility. But that is a known issue.

I don't know about messages about "system python", though that vaguely 
rings a bell as a bdist_mpkg issue.

I'll add information about numpy to the ReadMe for future binary 
installers. Aside from that, I believe I've done everything I reasonably 
can to clarify the requirements for the binary installer.

-- Russell


--
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Why is pip not mentioned in the Installation Documentation?

2012-11-16 Thread Russell E. Owen
In article <[email protected]>,
 Mathew Topper  wrote:

> Hi,
> 
> I'm interested to know why the pip package manager is not more widely 
> supported for installation of python packages like matplotlib? 
> Matplotlib seems to be particularly slowly updated in the Fedora 
> repositories, for example, so I often find that a source installation is 
> necessary. I know this isn't especially difficult for the experienced 
> user, but surely using something like pip would make this process for 
> accessible for all users of python packages, particularly those that do 
> not receive much attention from the big distribution maintainers? Yet, 
> pip doesn't get a mention on the installation documentation of 
> matplotlib or many other python packs.
> 
> I would love to hear anyone's thoughts on this matter.

Unfortunately pip cannot install binaries, so any user that tried to 
install matplotlib using pip would have to have a C compiler.

Unfortunately many users do not have a compiler on MacOS and Windows.

In addition, matplotlib has some important dependencies that may not be 
available on all systems. MacOS now includes all necessary libraries. I 
don't think that is true for most flavors linux (though there is 
probably an easy way to get all missing packages). I have no idea about 
Windows.

I agree pip should be mentioned, but I don't see it as a viable 
mainstream means of installing matplotlib.

(Does it even work with matplotlib? I've never tried it.)

-- Russell


--
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Why is pip not mentioned in the Installation Documentation?

2012-11-26 Thread Russell E. Owen
In article <[email protected]>,
 Ludwig Schwardt 
  wrote:

> Pip works beautifully on the Mac since Lion, once you install pkg-config. 
> This allows matplotlib to pick up the dependencies from the system (i.e. 
> libpng, libfreetype and zlib)

I had not heard of pkg-config before. It looks very useful.

>...
> [1] For me the only downside of the installer is the use of Python.org Python 
> instead of the default "system" Python, as the latter makes more sense to me 
> for a standard installation (and avoids having multiple Pythons on your 
> system, which is a Good Thing). Python.org Python used to be a mandatory 
> install on older Mac systems such as Tiger / 10.3, but this is no longer a 
> compelling argument for me on newer systems.

Simplicity is nice, and it's a shame there are so many 3rd party 
versions of python now (python.org, Enthought, ActiveState).

Nonetheless, there are some good reasons for avoiding system python, 
including:
- Apple rarely updates system python, so one does not get bug fixes
- If the operating system uses python for anything then it's safest to 
leave it alone

Regards,

-- Russell


--
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Mac binary installer for Python 3 delayed

2012-12-14 Thread Russell E. Owen
It turns out I won't be able to make a Mac binary installer for 
matplotlib anytime soon. I use bdist_mpkg to make the Mac binary 
installers for MacOS X, and the current release of bdist_mpkg (4.4) is 
not compatible with Python 3. I don't know how to make binary installers 
without bdist_mpkg, though I'm sure it can be done.

Also note that there are no numpy binary installers for MacOS X python 
3. This *may* be due to the same issue.

Fortunately, it is very easy to install matplotlib from source (much 
easier than it used to be, thanks to patching setupext.py for darwin).

-- Russell


--
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] matplotlib Mac binary that works with python.org python and older MacOS X?

2010-06-30 Thread Russell E. Owen
I'm trying to find a matplotlib 0.99.3 binary installer that works with 
the standard python.org Python (preferably 2.6) and hence works with Mac 
OS X 10.4 or greater. (I distribute an application that needs to run on 
a wide range of versions of Mac OS X).

The official binary I found refuses to install on my machine claiming it 
wants system python 2.6 (I happen to be running 10.5 so that's no use to 
me, and some users of my application are running 10.4).

I also tried the egg, but of course it fails -- presumably it's based on 
the same build.

If a binary isn't available I"ll make my own, but I figured I'd check 
first.

-- Russell


--
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplotlib Mac binary that works with python.org python and older MacOS X?

2010-07-01 Thread Russell E. Owen
In article ,
 "Russell E. Owen"  wrote:

> I'm trying to find a matplotlib 0.99.3 binary installer that works with 
> the standard python.org Python (preferably 2.6) and hence works with Mac 
> OS X 10.4 or greater. (I distribute an application that needs to run on 
> a wide range of versions of Mac OS X).
> 
> The official binary I found refuses to install on my machine claiming it 
> wants system python 2.6 (I happen to be running 10.5 so that's no use to 
> me, and some users of my application are running 10.4).
> 
> I also tried the egg, but of course it fails -- presumably it's based on 
> the same build.
> 
> If a binary isn't available I"ll make my own, but I figured I'd check 
> first.
> 
> -- Russell
> 
> 
> --
> This SF.net email is sponsored by Sprint
> What will you do first with EVO, the first 4G phone?
> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first

I made binaries (on Mac OS X 10.5) using my instructions:
<http://www.astro.washington.edu/users/rowen/BuildingMatplotlibForMac.htm
l>

They are available from here, for now:
<http://www.astro.washington.edu/users/rowen/python/>

please test them. If they work then I hope the matplotlib folks will 
consider serving them as official "for 3rd-party Python" binaries
(as opposed to the current ones they are serving, which are for Apple's 
Python).

-- Russell


--
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplotlib Mac binary that works with python.org python and older MacOS X?

2010-07-01 Thread Russell E. Owen
In article 
,
 John Hunter  wrote:

> On Thu, Jul 1, 2010 at 12:56 PM, Christopher Barker
>  wrote:
> > Russell E. Owen wrote:
> >> I made binaries (on Mac OS X 10.5) using my instructions:
> >> <http://www.astro.washington.edu/users/rowen/BuildingMatplotlibForMac.htm
> >> l>
> >>
> >> They are available from here, for now:
> >> <http://www.astro.washington.edu/users/rowen/python/>
> >>
> >> please test them.
> >
> > Thanks Russell, this looks great -- it seems to be working on my OS-X
> > 10.5 PPC box.
> >
> >> If they work then I hope the matplotlib folks will
> >> consider serving them as official "for 3rd-party Python" binaries
> >> (as opposed to the current ones they are serving, which are for Apple's
> >> Python).
> >
> > +1 -- these really should be the official ones (nothing wring with
> > serving up the 10.6 ones too, if they are well labeled)
> 
> I'm happy to upload them, how do you suggest they should all be named?

Great!

I suggest that the current file named:
  matplotlib-0.99.3-py2.6-macosx-10.6-universal.egg
be renamed to something like:
  matplotlib-0.99.3-ApplePython2.6-macosx-10.6.egg

This is based on two things:
- It needs a clear indicator that it requires Apple's python 2.6. Note 
that this is very unusual (I know of no other binaries built like this) 
so the name really needs to emphasize this
- I'm not sure what universal meant (clearly it's not Intel+PPC, which 
is the old meaning of the term). I suggest removing it or replacing it 
with something clearer. If you mean it has both 32-bit and 64-bit 
version then perhaps you could say i32-i64.

My binaries are presently named:
matplotlib-0.99.3-py2.5-macosx10.4-2010-06-30.dmg
matplotlib-0.99.3-py2.6-macosx10.4-2010-06-30.dmg

The easy thing is to simply remove the date; the name then matches the 
scheme used by numpy and scipy so it will probably be clear to most 
users. However, I do realize it may be a bit ambiguous since you also 
serve the other version, so you could indicate python.org python in some 
way, e.g.:
...-python_org_python26

You might consider whether you are planning to continue building 
binaries that work with Apple's python. Personally I am never in favor 
of using Apple's python for several reasons:
- Apple Python is part of the operating system, so it's safer to treat 
it as "do not touch".
- It makes packaging an application impossible; the application cannot 
include Python and so will not run on a variety of versions of Mac OS X
- Some packages cannot be upgraded (for instance Twisted) because Apple 
already provides a version.
- Apple never seems to update Python, so you don't get bug fixes.

However, at present I don't know if there is a Python 2.6 that is both 
compatible with older versions of Mac OS X and is built with 64-bit 
support. If there is not, then we'll need for two binary installers 
anyway (though I'd prefer both were for 3rd party versions of Python if 
possible).

-- Russell


--
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplotlib Mac binary that works with python.org python and older MacOS X?

2010-07-01 Thread Russell E. Owen
In article ,
 "Russell E. Owen"  wrote:

> My binaries are presently named:
> matplotlib-0.99.3-py2.5-macosx10.4-2010-06-30.dmg
> matplotlib-0.99.3-py2.6-macosx10.4-2010-06-30.dmg
> 
> The easy thing is to simply remove the date; the name then matches the 
> scheme used by numpy and scipy so it will probably be clear to most 
> users.

I guess I'm blind. Here is the naming scheme used by numpy and scipy:
scipy-0.7.2-py2.6-python.org.dmg
numpy-1.4.1-py2.6-python.org.dmg

One option is to simply adopt that (replacing python.org with Apple for 
your binary). But I really don't like omitting the minimum version of 
Mac OS X it works with (not to mention omitting "mac" altogether!), so I 
recommend the following, where I moved the python source before the 
version of python because otherwise the Apple in 
"py2.6-Apple-macosx10.6" might seem to refer to macosx instead of python:

matplotlib-0.99.3-Apple-py2.6-macosx10.6.dmg
for your existing binary, and
matplotlib-0.99.3-python-py2.5-macosx10.4.dmg
matplotlib-0.99.3-python-py2.6-macosx10.4.dmg
for mine.

-- Russell


--
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplotlib Mac binary that works with python.org python and older MacOS X?

2010-07-02 Thread Russell E. Owen
In article <[email protected]>,
 Christopher Barker  wrote:

> Russell E. Owen wrote:
> > However, at present I don't know if there is a Python 2.6 that is both 
> > compatible with older versions of Mac OS X and is built with 64-bit 
> > support.
> 
> FWIW, I think the official 2.7 builds will be Intel32+Intel64+PPC32
> 
> I don't know if Ronald is going to back=port any of that for 2.6, but I 
> kind of doubt it.
> 
> -Chris

That sounds useful. Can bdist_mpkg handle Intel64?

-- Russell


--
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Help Installing on Mac OS X

2010-07-08 Thread Russell E. Owen
In article ,
 Shir Livne  wrote:

> Hi,
> 
> I downloaded the files from the site, but when i type "import  
> matplotlib" in python, it responds with "ImportError: No module named  
> matplotlib"
> 
> Does anyone mind going through the download steps for me? I probably  
> forgot something simple.

What file did you download?

If it was a binary installer, then which python are you using (open a 
Terminal and type "which python"). You should see a path starting with 
/Library, NOT with /System/Library.

If the path starts with /System/Library then that explains your problem: 
you are using the built-in python instead of the python from python.org 
(though the binary *may* work with other 3rd party pythons as well, e.g. 
Enthought or ActiveState).

So, the steps are:
- Download and install a suitable python from  (I 
recommend 2.6.x, but 2.5.x is also fine; we don't have a matplotlib 
binary for 2.7 yet because it is so new)
- Download and install the matching matplotlib Mac binary (for Python 
2.5 or 2.6).

Regards,

-- Russell


--
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Matplotlib 1.0 dateutils missing on MacOS X

2010-07-08 Thread Russell E. Owen
In article <[email protected]>,
 Edward Barnard  
 wrote:

> Hi All
> 
> I had a problem installing matplotlib 1.0.0 on MacOS X 10.6 using python.org 
> 2.6.5 with the binary installer (dmg). When importing pylab, datautils was 
> missing. I fixed that by easy_installing python-dateutils, but it seems like 
> it should be included in the installer or listed in the install requirements.
> 
> Thanks for a great piece of software!
> 
> -Ed
> 
> 
> 
> --
> This SF.net email is sponsored by Sprint
> What will you do first with EVO, the first 4G phone?
> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first

I built the installer without dateutil and pytz packages.

At John Hunter's request I made new installers that do install these 
packages. I believe the new installers are now being served, so try 
downloading the installer and running it again.

Beware: the new installer always installs the versions it has; if you 
have a newer pytz or dateutil you want to keep, reinstall it afterwards 
or move it out of site-packages during the matplotlib install.


--
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Animation doc glitches

2010-08-06 Thread Russell E. Owen
I'm trying to learn how to make a fairly efficient strip chart display 
and have run into a few glitches:

The example strip_chart_demo.py is not annotated but does refer to a 
page 
Unfortunately that page does not exist. I suspect the desired page is:


However, that page has its own issues: all the links to code that I have 
tried are broken, e.g.:
anim.py = 
anim_tk.py = 
etc.

That page also says at one point:
"For backends that support the new API (GTKAgg) set useblit=True:"
and
"As noted above, only the GTKAgg supports the methods above to to the 
animations of selected actors."

However, it earlier claims:
"As of matplotlib-0.87, GTKAgg, TkAgg, WXAgg, and FLTKAgg support the 
methods discussed here."

If the first two quotes are needlessly restrictive then it would help to 
list the supported backends once and refer back to that if necessary.

These are minor complains. Having found this page it looks pretty 
straightforward to do what I want (especially since my data rate is slow 
enough that I can skip the fancy bit blitting).

One question: it appears that there is no way to append new data to the 
Line2D and occasionally flush the oldest data; instead I have to copy 
all data for every update. Is this so, or am I missing something?

-- Russell


--
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] installation of matplotlib on OS X 10.5 with python.org Python 2.6

2010-08-06 Thread Russell E. Owen
In article ,
 Stephen T.  
 wrote:

> Hi, I am having trouble installing matplotlib. I have OS X 10.5 with Python 
> 2.6
>  downloaded and installed from python.org.
>  (10.5 came with Apple
>  Python 2.5). I've also installed NumPy and SciPy for Python 2.6.

I encourage you to try the matplotlib 1.0.0 binary installer. It was 
built to use the python.org Python (versions are available for Python 
2.5 and 2.6; the latter did have a known problem with permissions on the 
icon files; you can fix that manually or a new installer with that 
problem fixed should be up now or shortly).

Another option is to wade through the build instructions. I've got some 
here:


-- Russell


--
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Hints on sizing plot elements?

2010-08-11 Thread Russell E. Owen
I'm making a strip chart widget (which I plan to make publicly available 
when finished). The basics are working fine, but the automatic sizing is 
not doing so well. Strip charts are typically short, and when suitably 
short the X axis annotations are partially truncated.

So...can I convince the automatic sizer to always show the full X (time) 
axis annotations and put all the variable sizing into the data area? Or 
do I have to manually set them somehow?

Also, is there a way from my software (not a .matplotlibrc file) to 
globally make the default background color white for axis annotation 
areas? Right now the background is gray for annotations and while for 
plot area and I'd prefer it was all white.

-- Russell


--
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Matplotlib 1.0.0 OS X Binaries for Python 2.7?

2010-08-30 Thread Russell E. Owen
I don't think there is a release numpy that is compatible with Python 
2.7 (though it is due shortly in the form of numpy 1.5) and matplotlib 
requires numpy.

-- Russell

In article 
,
 Åke Kullenberg 
  wrote:

> I've seen some posts asking for the same thing, but there's been quite some
> time now. Does anyone know the progress? Should I wait, or just downgrade to
> 2.6 for now?
> 
> Thanks
> -
> --
> Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
> Be part of this innovative community and reach millions of netbook users 
> worldwide. Take advantage of special opportunities to increase revenue and 
> speed time-to-market. Join now, and jumpstart your future.
> http://p.sf.net/sfu/intel-atom-d2d
> -
> ___
> Matplotlib-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users

I


--
This SF.net Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] another incorrectly clipped PNG in the gallery

2010-09-22 Thread Russell E. Owen
In article <[email protected]>,
 Alan G Isaac  
 wrote:

> http://matplotlib.sourceforge.net/examples/pylab_examples/accented_text.html

It's realistic, and that has a lot to be said for it.

One of my problems with matplotlib is that it is far too willing to 
truncate axis labels and related information. I'd be much happier with a 
layout model that always showed the axis labels in full.

-- Russell


--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Tying X axes information together in multiple subplots?

2010-09-24 Thread Russell E. Owen
I'm making a set of plots (a strip chart) stacked on top of each other, 
all sharing the same X axis (time).

So far it appears that to get the X axis of each Subplot to match I have 
to set its properties independently.

Is there some way to tie them all together so that a user can set the 
properties of one and have it propagate? I'm particularly concerned 
about tick marks and the X grid lines; I only want to show tick labels 
on the bottom-most Subplot.

I suppose one possibility is to create some kind of object on which I 
can call Subplot.xaxis methods and have it apply those changes to all 
the Subplots. Has anyone done this?

-- Russell


--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] another incorrectly clipped PNG in the gallery

2010-09-24 Thread Russell E. Owen
In article 
,
 John Hunter  wrote:

> On Wed, Sep 22, 2010 at 8:31 PM, C M 
>  wrote:
> 
> > Until a more permanent solution is figured out, can anyone recommend
> > any workarounds, even if they are a little clunky?  I'm embedding mpl
> > plots in wxPython and am also finding this issue suboptimal.
> 
> Change your subplots adjust parameters to make the default bottom,
> left, wspace and hspace wider.  This will reduce the chance of
> overlaps.
> 
> http://matplotlib.sourceforge.net/search.html?q=subplots_adjust
> 
> The defaults can be changed in your rc file
> 
>   http://matplotlib.sourceforge.net/users/customizing.html
> 
> See also these recipes on the FAQ to automatically choose boundaries
> 
>   http://matplotlib.sourceforge.net/faq/howto_faq.html#move-the-edge-of-an-axe
>   s-to-make-room-for-tick-labels
> 
>   http://matplotlib.sourceforge.net/faq/howto_faq.html#automatically-make-room
>   -for-tick-labels
> 
> Automatic layout to avoid overlap is not an easy problem -- Michael
> Droetboom worked on it for a while but didn't get to a satisfactory
> point.  So far our philosophy has been : make it easy to customize
> rather than do it automatically.  I realize this is not always a good
> approach, especially in automated figure generators where you don't
> have access to the data ahead of time.

One possibility is to offer a mode whereby the font size for the 
annotations is fixed. It is then much easier to figure out how large a 
particular annotation must be before laying out the graph. That ought to 
make it much easier to leave enough room for axis labels and such.

Ideally in this mode the automatic layout would be improved so that axis 
labels were always visible. But even if that was a planned feature that 
was not initially implemented, having fixed font size would allow users 
to more easily lay things out as desired.

-- Russell


--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Tying X axes information together in multiple subplots?

2010-09-24 Thread Russell E. Owen
In article 
,
 Benjamin Root  wrote:

> On Fri, Sep 24, 2010 at 12:30 PM, Russell E. Owen 
>  wrote:
> 
> > I'm making a set of plots (a strip chart) stacked on top of each other,
> > all sharing the same X axis (time).
> >
> > So far it appears that to get the X axis of each Subplot to match I have
> > to set its properties independently.
> >
> > Is there some way to tie them all together so that a user can set the
> > properties of one and have it propagate? I'm particularly concerned
> > about tick marks and the X grid lines; I only want to show tick labels
> > on the bottom-most Subplot.
> >
> > I suppose one possibility is to create some kind of object on which I
> > can call Subplot.xaxis methods and have it apply those changes to all
> > the Subplots. Has anyone done this?
> >
> > -- Russell
> >
> >
> Russel, maybe this example might help?
> 
> http://matplotlib.sourceforge.net/examples/pylab_examples/shared_axis_demo.htm
> l
> 
> There are also some more advanced subplot layout methods available called
> axis_grid1 in the mpl_toolkits.
> 
> http://matplotlib.sourceforge.net/mpl_toolkits/axes_grid/users/overview.html
> 
> I hope this helps!
> 
> Ben Root

Thank you. sharex was just what I was looking for.

I was pleasantly surprised I could hide the x axis labels on the upper 
subplots using the following code:
for subplot in self.subplotArr[0:-1]:
# can't find API equivalent of pylab.setp so...
for ticklabel in subplot.get_xticklabels():
ticklabel.set_visible(False)
since it's a strip chart and new X ticks are constantly being created as 
time advances. Thank heavens it doesn't show labels on the new ones.

I also tried axis_grid1 but was unable to get plots, and since the other 
technique is working and more backward-compatible I'm happy to stick to 
that.

Regards,

-- Russell


--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] autoscale when adding data to a Line2D?

2010-09-24 Thread Russell E. Owen
I'm implementing a strip chart class by setting the data in a Line2D 
(well, one or more Line2D instances tied to one or more Subplots).

However, I find that when I do this I can't get the y axis to autoscale, 
even if I create the Line2Ds with animate=False.

Am I overlooking something really basic? If not, any suggestions?

Perhaps I should keep track of the y limits myself. That saves time when 
adding a new data point because I can compare it to cached limits 
(instead of scanning the whole data set). But it quickly gets messy if 
one handles nan correctly and matplotlib already does this so I was 
thinking matplotlib must have API code to help with this. But so far 
I've not figured it out from the docs (though matplotlib.ticker looks 
promising).

-- Russell


--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] autoscale when adding data to a Line2D?

2010-09-27 Thread Russell E. Owen
In article <[email protected]>,
 Eric Firing  wrote:

> On 09/26/2010 09:43 PM, Fernando Perez wrote:
> > Mmh,
> >
> > On Sun, Sep 26, 2010 at 10:56 PM, Jae-Joon 
> > Lee  wrote:
> >>
> >> Did you try autoscale_view method?
> >>
> >> http://matplotlib.sourceforge.net/api/axes_api.html?highlight=autoscale#mat
> >> plotlib.axes.Axes.autoscale_view
> >>
> >> Please post a sample script that reproduces the problem.
> >>
> >
> > I'm wondering if I'm doing something wrong then.  Just now I was
> > writing some notes about this for a tutorial, and tried this code:
> >
> > line, = plt.plot([1,2,3], label='my data')
> > plt.grid()
> > plt.title('My title')
> > x = np.linspace(0, 1)
> > y = x**2
> > line.set_data(x, y)
> > ax = gca()
> > ax.autoscale_view()
> > plt.draw()
> >
> > but I get the result shown in the screenshot.  Am I misusing
> > autoscale_view?  As best I can tell from the docstring, I'm making
> > correct use of it, but perhaps I'm missing something...
> 
> autoscale_view somewhat defeats the purpose of line.set_data, which is 
> intentionally minimalist.  If you want autoscaling after update, but 
> don't want to simply clear and plot, then you need to explicitly update 
> the Axes.dataLim.  You can do this using Axes.relim()
> prior to calling autoscale_view().

Thank you. That is exactly what I needed.

It looks like Axes.get_ybound() will return the min and max displayed y
so whenever I add a point I can test if it is within those bounds;
if it is not then I can call relim(). That should preserve the 
efficiency most of the time while still allowing autoscaling
and avoiding my having to keep accurate track of what's going on.

-- Russell


--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] strip chart: thanks for you help

2010-09-29 Thread Russell E. Owen
I finished my strip chart widget thanks to help from Tony S Yu, Benjamin 
Root and others here. It supports multiple subplots and multiple 
lines/subplot. Here's a copy if anyone is interested:

I plan to add it to the RO python package once I have tested it a bit 
more. Meanwhile, the example code at the end uses a prerelease RO module 
that I've also uploaded: 


It uses the TkAgg back end, but is easily ported (as usual, event timing 
is the main issue; I wish Python had its own event model that all GUIs 
could use).

I think I finally got the animation API figured out well enough to 
produce a robust result. Strip charts are intrinsically poor candidates 
for the animation API because the time axis is constantly shifting, but 
nonetheless animation does produce a small reduction in CPU usage.

Any feedback would be most welcome.

Regards,

-- Russell


--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] strip chart: thanks for your help

2010-10-04 Thread Russell E. Owen
In article ,
 "Russell E. Owen"  wrote:

> I finished my strip chart widget thanks to help from Tony S Yu, Benjamin 
> Root and others here. It supports multiple subplots and multiple 
> lines/subplot. Here's a copy if anyone is interested:
> <http://www.astro.washington.edu/users/rowen/python/StripChartWdg.py>
> I plan to add it to the RO python package once I have tested it a bit 
> more. Meanwhile, the example code at the end uses a prerelease RO module 
> that I've also uploaded: 
> <http://www.astro.washington.edu/users/rowen/python/RandomWalk.py>
> 
> It uses the TkAgg back end, but is easily ported (as usual, event timing 
> is the main issue; I wish Python had its own event model that all GUIs 
> could use).
> 
> I think I finally got the animation API figured out well enough to 
> produce a robust result. Strip charts are intrinsically poor candidates 
> for the animation API because the time axis is constantly shifting, but 
> nonetheless animation does produce a small reduction in CPU usage.
> 
> Any feedback would be most welcome.
> 
> Regards,
> 
> -- Russell

Now released in RO 2.6.0 as RO/Wdg/StripChartWdg.py
<http://pypi.python.org/pypi/RO/2.6.0>

-- Russell


--
Virtualization is moving to the mainstream and overtaking non-virtualized
environment for deploying applications. Does it make network security 
easier or more difficult to achieve? Read this whitepaper to separate the 
two and get a better understanding.
http://p.sf.net/sfu/hp-phase2-d2d
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] New Mac binary installer for Python 2.6; do we bother with Python 2.5?

2010-10-06 Thread Russell E. Owen
I finally got hold of a Mac that can run 10.4 and was finally able to 
build a new binary installer for Python 2.6 (as well as one for PIL 
1.1.7) is truly compatible with Mac OS X 10.3.9.

For now it is available here:

though I hope it will end up on the official site at some point.

I have not tested the wx back end and would be grateful if somebody had 
time to do so.

I attempted to build a binary installer for Python 2.5.x but ran into 
problems: Mac binaries for Python 2.5 aren't compatible with 3rd party 
versions of Tk, which causes a mess for matplotlib. There are 
workarounds, but given the state of Mac python 2.5 I'm not sure it's 
worth the bother.

I propose not having a matplotlib binary installer for Python 2.5 and 
getting a pair for Python 2.7 32-bit (10.3.9 and later) and 64-bit (10.5 
and later).

What do others think?

-- Russell


--
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Mac binary updated: bad file permission

2010-10-08 Thread Russell E. Owen
The Mac installer for matplotlib that I recently announced had a bug: a 
file in dateutil had bad permissions. I think I've finally got that 
straightened out and there's a new installer here:


My apologies for the error.

-- Russell


--
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Memory leak; user error or bug?

2010-12-01 Thread Russell E. Owen
I'm seeing a nasty memory leak in my strip chart widget using matplotlib 
1.0, TkAgg and Mac OS X 10.5

I've posted a minimal version here:


It doesn't seem to matter if I use the animation API or not (the example 
does not).

Any ideas? If this is a bug I'll report it, but I hope I'm just doing 
something wrong.

-- Russell


--
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Memory leak; user error or bug?

2010-12-01 Thread Russell E. Owen
In article <[email protected]>,
 Michael Droettboom  
 wrote:

> On 12/01/2010 01:40 PM, Russell E. Owen wrote:
> > I'm seeing a nasty memory leak in my strip chart widget using matplotlib
> > 1.0, TkAgg and Mac OS X 10.5
> >
> > I've posted a minimal version here:
> > <http://www.astro.washington.edu/users/rowen/python/MinimalStripChartWdg.
> > py>
> >
> > It doesn't seem to matter if I use the animation API or not (the example
> > does not).
> >
> > Any ideas? If this is a bug I'll report it, but I hope I'm just doing
> > something wrong.
> I don't have a Mac to try this on -- however, I don't see the leak on 
> Fedora 14/Python 2.7/Numpy 1.5.1/Tkinter with both matplotlib 1.0 and 
> matplotlib SVN head.  That may narrow it down to something Mac OS 
> X-specific.  Sorry that's not totally helpful, but it's a data point.

Thank you; that is very helpful. Unfortunately that suggests it is 
Mac-specific or Tcl/Tk-version-specific which could make it hard to 
track down. I'll report it as a bug in any case.

-- Russell


--
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] memory "leak" caused by canvas.draw()

2010-12-09 Thread Russell E. Owen
I explored the memory leak in my strip chart widget some more and found 
that it is caused by calling canvas.draw(), where canvas is:

figure = matplotlib.figure.Figure(figsize=(8, 2), frameon=True)
canvas = FigureCanvasTkAgg(figure, self)

canvas.show() exhibits exactly the same problem.

So...what is the right way to redraw a plot after its X axes have been 
changed?

-- Russell


--
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Bus error on import - Mac OS X (10.5.8) Matplotlib 1.0.0

2010-12-09 Thread Russell E. Owen
In article <[email protected]>,
 Kaushik Ghose  
 wrote:

> Hi Guys,
> 
> I did a search on the mailing list but could not come up with a solution, so 
> I 
> am crying "Uncle" and writing.
> 
> I installed matplotlib 1.0.0 from the package on SF 
> (http://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-1.0/ma
> tplotlib-1.0.0-python.org-py2.6-macosx10.4.dmg/download)
> 
> I assumed that 10.4 would work on my 10.5 - perhaps that is where I went 
> wrong?
> 
> I installed it and got, satisfactorily:
> 
> import matplotlib
> matplotlib.__version__
> ---> '1.0.0'
> 
> But when I do
> 
> import pylab
> 
> I get a bus error that throws me out of ipython.

It should work on Mac OS X 10.4.

A newer version of this binary is available here, which I recommend 
instead:


A few things to try:
- Make sure you have Python 2.6 from python.org
- Make sure you have a good numpy build, preferably of 1.5 or 1.5.1
- matplotlib 1.0.0 will crash if it has a problem with the font cache 
(though I don't think that is what caused your crash); to fix that 
delete the font cache in the ~/.matplotlib directory. That problem 
should be fixed in 1.0.1.

-- Russell


--
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Updating tick labels on animated plot

2010-12-13 Thread Russell E. Owen
In article 
,
 Søren Nielsen 
  wrote:

> Hi,
> 
> I have an animated plot and I'm having trouble updating the tick labels
> after I blit new data to the canvas. I've looked through the documentation
> and it's not clear to me how I can update the x and y axis ticks during an
> animation. Anyone here know how to do this?

I am not an expert but...

The only way I know to update the tick labels and such is to call the 
draw() method on your canvas.

if you have to update the tick labels nearly as often as you add data 
then you probably should not bother with the animation API. Just update 
the data and then call canvas.draw() to update both the data and the 
axis ticks.

Regards,

-- Russell


--
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Adding 2 Line2D objects to a Subplot

2010-12-21 Thread Russell E. Owen
In article <[email protected]>,
 Jose Guzman  
 wrote:

> Hi everybody
> 
> I wanted to collect a combination of plots to insert then in a subplot. 
> I choose to create Line2D objects to use the .add_line() method of the 
> AxesSubplot class, but unfortunately this does lead to the desired results.
>...

Is the appended closer to what you had in mind?

-- Russell

from matplotlib.lines import Line2D
from matplotlib.pyplot import figure, show

import numpy as np

def subplot_foo(n):
 """ returns a the combination of 2 Line2D instances """
 x = np.arange(0, 200, 0.1)
 y = np.random.randn(len(x))
 print len(x)
 y2 = y+n

 line1 = Line2D(x, y, color = 'k')
 line2 = Line2D(x, y2, color = 'r')

 return line1, line2


fig = figure() # create Figure object
for i in range(1,5):
 ax = fig.add_subplot(2,2,i)

 subplots = subplot_foo(i)
 for subplot in subplots:
 ax.add_line(subplot)

show()


--
Forrester recently released a report on the Return on Investment (ROI) of
Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
within 7 months.  Over 3 million businesses have gone Google with Google Apps:
an online email calendar, and document program that's accessible from your 
browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] mac osx 10.6 matplotlib installation error: "lipo: can't open input file: /var/tmp//*.out"

2011-01-18 Thread Russell E. Owen
In article <[email protected]>,
 Leslie Burnett 
  wrote:

> Pathways leading to the error message:
> 
> I obtained Matplotlib from the matplotlib home page download link to 
> sourceforge
> 
> a) mpkg/dmg installation 1.0.1-r0 fails with message "can't be installed on 
> this disk. matplotlib requires System Python 2.6 to install"

The mpkg/dmg installer requires python from python.org, not Apple's 
built-in python (despite the incorrect error message). The README that 
is displayed by the installer does explain this, but it is easy to miss.

Note that the incorrect error message is a known bug in the software 
that creates mpkg installers.

I suggest you use the binary installer because building from source is 
rather a lot of work, due to the need to install dependencies.

-- Russell


--
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] installation problem on Mac

2011-06-16 Thread Russell E. Owen
In article ,
 Rebecca Gray  wrote:

> I am trying to install matplotlib on my Mac OS X 10.6.6. I currently have
> Python 2.7.2 installed. I tried installing
> ***matplotlib-1.0.1-python.org-32bit-py2.7-macosx10.3.dmg.
> The installation appears to run fine, but when I try to import pylab * I am
> getting the following error message:
> 
> >>> from numpy import *
> >>> import pylab
>...
> ImportError:
> dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-pa
> ckages/matplotlib/_path.so,
> 2): no suitable image found.  Did find:
> 
> /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/
> matplotlib/_path.so:
> no matching architecture in universal wrapper
> 
> I am new to Python and any help would be greatly appreciated.
> 
> Thanks,
> 
> Rebecca

Which Python 2.7.2 are you using? The matplotlib installer is only 
compatible with the 32-bit version from python.org and I suspect you are 
using the 64-bit version or some other distribution entirely.

If you are definitely using the 32-bit python.org version then could you 
please execute the "file" command on _path.so?

When I do that for mine I get:
d-172-28-191-121:matplotlib rowen$ file _path.so
_path.so: Mach-O universal binary with 2 architectures
_path.so (for architecture ppc): Mach-O bundle ppc
_path.so (for architecture i386):   Mach-O bundle i386

-- Russell


--
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Legend for stacked histogram?

2011-06-30 Thread Russell E. Owen
I am trying to make a legend for a stacked histogram using matplotlib 
1.0.1 and it's not working.

Here's what I've tried so far:

count, bins, ignored = pyplot.hist(
(matchedStarPsfMags, unmatchedRefStarPsfMags,
  unmatchedSourcePsfMags),
bins=30, histtype='barstacked', normed=True)
pyplot.legend(("matched stars", "unmatched stars", \
  "false detections"), loc='upper left')

This produces a nice stacked histogram with red, green and blue. 
Unfortunately the legend is blue for all three entries, so the legend is 
useless!

I figured I could label the data instead. The documentation for hist 
says:
label:
String, or sequence of strings to match multiple datasets. Bar charts 
yield multiple patches per dataset, but only the first gets the label, 
so that the legend command will work as expected:

That last sentence sounded really ominous in this context, but I figured 
I would try it anyway. Unfortunately this code fails:

count, bins, ignored = pyplot.hist(
(matchedStarPsfMags, unmatchedRefStarPsfMags,
   unmatchedSourcePsfMags),
label = ("matched stars", "unmatched stars",
"false detections"),
bins=30, histtype='barstacked', normed=True)
pyplot.legend(loc='upper left')

with this error:

Traceback (most recent call last):
  File "bin/measDepth.py", line 291, in 
pyplot.legend(loc='upper left')
  File 
"/lsst/DC3/stacks/gcc443/15oct2010/Linux64/external/matplotlib/0.98.5.2+1
/lib/python/matplotlib/pyplot.py", line 2441, in legend
ret =  gca().legend(*args, **kwargs)
  File 
"/lsst/DC3/stacks/gcc443/15oct2010/Linux64/external/matplotlib/0.98.5.2+1
/lib/python/matplotlib/axes.py", line 3777, in legend
label != '' and not label.startswith('_')):
AttributeError: 'tuple' object has no attribute 'startswith'

In other words the documentation appears to be incorrect that a sequence 
of strings is acceptable.

Any suggestions?

-- Russell


--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Legend for stacked histogram?

2011-06-30 Thread Russell E. Owen
In article ,
 "Russell E. Owen"  wrote:

> I am trying to make a legend for a stacked histogram using matplotlib 
> 1.0.1 and it's not working.
> 
> Here's what I've tried so far:
> 
> count, bins, ignored = pyplot.hist(
> (matchedStarPsfMags, unmatchedRefStarPsfMags,
>   unmatchedSourcePsfMags),
> bins=30, histtype='barstacked', normed=True)
> pyplot.legend(("matched stars", "unmatched stars", \
>   "false detections"), loc='upper left')
> 
> This produces a nice stacked histogram with red, green and blue. 
> Unfortunately the legend is blue for all three entries, so the legend is 
> useless!
> 
> I figured I could label the data instead. The documentation for hist 
> says:
> label:
> String, or sequence of strings to match multiple datasets. Bar charts 
> yield multiple patches per dataset, but only the first gets the label, 
> so that the legend command will work as expected:
> 
> That last sentence sounded really ominous in this context, but I figured 
> I would try it anyway. Unfortunately this code fails:
> 
> count, bins, ignored = pyplot.hist(
> (matchedStarPsfMags, unmatchedRefStarPsfMags,
>unmatchedSourcePsfMags),
> label = ("matched stars", "unmatched stars",
> "false detections"),
> bins=30, histtype='barstacked', normed=True)
> pyplot.legend(loc='upper left')
> 
> with this error:
> 
> Traceback (most recent call last):
>   File "bin/measDepth.py", line 291, in 
> pyplot.legend(loc='upper left')
>   File 
> "/lsst/DC3/stacks/gcc443/15oct2010/Linux64/external/matplotlib/0.98.5.2+1
> /lib/python/matplotlib/pyplot.py", line 2441, in legend
> ret =  gca().legend(*args, **kwargs)
>   File 
> "/lsst/DC3/stacks/gcc443/15oct2010/Linux64/external/matplotlib/0.98.5.2+1
> /lib/python/matplotlib/axes.py", line 3777, in legend
> label != '' and not label.startswith('_')):
> AttributeError: 'tuple' object has no attribute 'startswith'
> 
> In other words the documentation appears to be incorrect that a sequence 
> of strings is acceptable.
> 
> Any suggestions?

Oops. I was able to answer my own question.

It turns out I was using an ancient version of matplotlib (0.98.5.2) (I 
was using a remote server and forgot to check).

The second version does work with matplotlib 1.0.1 and produces a nice 
legend with the correct color for each entry. Yaay!

The first version produces a useless legend with all colors the same on 
both modern matplotlib and the ancient matplotlib. So use the second 
method of specifying label=(...) in the hist command.

-- Russell


--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplotlib can't find pygtk during build

2007-02-05 Thread Russell E Owen
At 9:42 AM -0800 2007-02-05, Christopher Barker wrote:
>Stephen Uhlhorn wrote:
>>My python is from ActiveState (Framework) which
>>was recommended by the scipy people.
>
>>Here's the real saga. I had a working Fink installaiton of
>>python/numpy/scipy/matplotlib until an update to scipy broke critical
>>functions (fopen). The fix is in cvs, so this whole mess started in an
>>attempt to use a cvs version of scipy.
>
>You could (should) have re-built scipy inside your fink distro.

I would like to add that I used to keep a unix/X11 build of python on 
my Mac in parallel with a framework build so I could test a GUI app 
on X11 and Aqua. (I build the stuff myself instead of using fink; I 
never could get comfortable with fink). In any case, I eventually 
gave up. Installing packages that had a GUI interface took extra work 
-- for the X11 python I had to temporarily hide the Aqua GUI stuff. 
Eventually I gave up and ditched the X11 version.

But if you *only* use fink then this comment is irrelevant--they've 
handled it for you.

>>I tried wxpython2.6 first, but figure windows never got drawn on my
>>display, even when I used pythonw.
>
>wxPython 2.6.3, as distributed on the wxPython site and pythonmac, 
>should work with MPL. I've lost track of whether there is a properly 
>built binary of MPL on pythonmac at this point. Search these 
>archives, and you'll see discussion of how to do it, or send a note 
>to me if this one fails:
>
>http://pythonmac.org/packages/py24-fat/index.html
>
>Russell, if  you're listening -- did you ever post your binary for 
>Python2.4, wxPython2.6.3 ?

It's up. Bob Ippolito put it up shortly after he got back from vacation.

-- Russell

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] problem with show()

2007-02-05 Thread Russell E. Owen
In article <[EMAIL PROTECTED]>,
 Chiara Caronna <[EMAIL PROTECTED]> wrote:

> I,
> I have a problem with showing plot. When I run this code:
> 
> figure(1)
> semilogx(data[:,0],data[:,1])
> savefig('try.png')
> show()
> 
> 
> It save the plot properly, but it doesn't show it. I tried to run it
> with "--verbose-helpful" and this is the output:
> 
> 
> matplotlib data path
> /usr/local/lib/python2.4/site-packages/matplotlib/mpl-data
> $HOME=/users/caronna
> CONFIGDIR=/users/caronna/.matplotlib
> loaded rc file
> /usr/local/lib/python2.4/site-packages/matplotlib/mpl-data/matplotlibrc
> matplotlib version 0.87.7
> verbose.level helpful
> interactive is False
> platform is linux2
> numerix numpy 1.0.1
> font search path
> ['/usr/local/lib/python2.4/site-packages/matplotlib/mpl-data']
> loaded ttfcache file /users/caronna/.matplotlib/ttffont.cache
> backend Agg version v2.2
> 
> Does anyone know what's the problem?

I'm not familiar with the "Agg" back end but I suspect it does not 
support output on a display. Try TkAgg, WXAgg or GTKAgg instead 
(depending what matplotlib was built to support) e.g. by editing 
~/.matplotlib/matplotlibrc

-- Russell


-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] ANN: matplotlib-0.90.0

2007-02-20 Thread Russell E. Owen
In article <[EMAIL PROTECTED]>,
 "Samuel M. Smith" <[EMAIL PROTECTED]> 
 wrote:

> >
> >> which versions of wxPython are supported?
> >
> > I haven't tried the new one, but the last release worked well with
> > wxPython2.6.3, but had some issues with 2.8.* -- I don't think anyone
> > has addressed those yet.
> >
> 
> Just to confirm, the binary posted at the following
> http://downloads.sourceforge.net/matplotlib/matplotlib-0.90.0-py2.5- 
> macosx-10.4-fat.egg?modtime=1171118530&big_mirror=0
> was compiled to work with wxPython 2.6 but may work with wxPython 2.8?

It was compiled with wxPython 2.6. It will NOT work with wxPython 2.8.

What Chris is referring to is that when I built matplotlib against 
wxPython 2.8 (in hopes of serving that at pythonmac.org) I ran into 
several problems:
- there appears to be broken code in matplotlib's wx support (making us 
wonder how and why it works with wxPython 2.6 at all)
- fixing that left something that ran but had some odd problems

> Shouldn't the version of wxPython also get included in the name along  
> with the python version and os version?

That information is in the ReadMe file in the installer.

Keep in mind that we have:
- which back ends are supported
- which numeric packages are support
I don't want to try to fit all that into a file name.

-- Russell


-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Intermittent Matplotlib crash on OS X

2007-02-20 Thread Russell E. Owen
In article <[EMAIL PROTECTED]>,
 Anand Patil <[EMAIL PROTECTED]> wrote:

> Hi all,
> 
> Matplotlib occasionally crashes Python at the end of a long program on 
> my powerbook g4 running OS X 10.4. gdb output follows:
> 
> Program received signal EXC_BAD_ACCESS, Could not access memory.
> Reason: KERN_INVALID_ADDRESS at address: 0x0a68fe40
> 0x002eae50 in visit_decref (op=0x28a1cb0, data=0x0) at 
> /Users/ronald/Python/r25/Modules/gcmodule.c:270
> 270 /Users/ronald/Python/r25/Modules/gcmodule.c: No such file or 
> directory.
> in /Users/ronald/Python/r25/Modules/gcmodule.c
> 
> or
> 
> Program received signal EXC_BAD_ACCESS, Could not access memory.
> Reason: KERN_PROTECTION_FAILURE at address: 0x0056
> 0x002eae50 in visit_decref (op=0x28a17e0, data=0x0) at 
> /Users/ronald/Python/r25/Modules/gcmodule.c:270
> 270 in /Users/ronald/Python/r25/Modules/gcmodule.c
> 
> It's always something like that, and it always happens after the little 
> Python icon starts bouncing around in the dock. I don't know anyone 
> named Ronald and no such directory exists on my machine.

What version of matplotlib, what version of Python and where did you 
them from from (build from source, some binary installer, fink...?)

-- Russell


-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] ANN: matplotlib-0.90.0

2007-02-20 Thread Russell E Owen
At 2:33 PM -0700 2007-02-20, Samuel M. Smith wrote:
>>>Shouldn't the version of wxPython also get included in the name along
>>>with the python version and os version?
>>
>>That information is in the ReadMe file in the installer.
>
>I will try to remember to look there in the future to know which wx 
>is supported, thanks.
>
>
>The matplotlib on sourceforge
>http://downloads.sourceforge.net/matplotlib/matplotlib-0.90.0-py2.5-macosx-10.4-fat.egg?modtime=1171118530&big_mirror=0
>
>is an egg but doesn't install with easy_install. Complains there is 
>no setup.py file.
>I copied the .egg directory into site-packages but it is not 
>automatically included in sys.path
>when I run the python interpreter.
>
>I have to manually do this:
  from pkg_resources import require
  require("matplotlib")
>[matplotlib 0.90.0 
>(/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib-0.90.0-py2.5-macosx-10.4-fat.egg)]
>
>for it to be accessible.
>
>I guess I have to add it manually to my PYTHONPATH or else generate 
>a .pth file and put it in site-packages
>to get it automatically added to sys.path?
>
>In the past the distributions were a little more user friendly for installing.
>I know I can't complain too much since you are doing all the work.
>Just wondering if I missed something when I tried to install it.

Oops, I just realized how misleading my earlier message was. I do NOT 
build the official matplotlib Mac packages. I have been building the 
packages at pythonmac.org. I started that because an earlier Python 
2.4 matplotlib package crashed when using a user-installed Tcl/Tk* 
and just never got out of the habit.

So I don't have anything to do with the official matplotlib Mac 
binaries and I have no idea what's in their ReadMe files. I *hope* 
they include the necessary info about what version of wxPython is 
required and all that, but I don't know.

I can't help you with easy_install either. Sorry.

-- Russell

* The crash stems from a limitation of the Mac build of Python 2.4 
that was fixed in 2.5. By default MacPython 2.4 does not find a 3rd 
party Tcl/Tk. There's a simple patch to fix this but it appears that 
binary packages that use Tkinter may not work with 3rd party Tcl/Tk 
unless the patch was applied by the person doing the build.

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] broken download links

2007-02-20 Thread Russell E Owen
If I go to the matplotlib download page:


then there is a table showing "matplotlib" and "matplotlib-toolkits". 
Clicking on "Download" or "matplotlib-0.90.0" results in a page with 
no files.

On the other hand, clicking on "matplotlib" (the upper-left link of 
the table) does the right thing. So does scrolling down, but that may 
be not be obvious unless one has a really big window.

-- Russell

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] ANN: matplotlib-0.90.0

2007-02-20 Thread Russell E Owen
At 4:48 PM -0700 2007-02-20, Samuel M. Smith wrote:
>On Feb 20, 2007, at 14:47 , Russell E Owen wrote:
>
>>>
>>>In the past the distributions were a little more user friendly for 
>>>installing.
>>>I know I can't complain too much since you are doing all the work.
>>>Just wondering if I missed something when I tried to install it.
>>
>>Oops, I just realized how misleading my earlier message was. I do NOT
>>build the official matplotlib Mac packages. I have been building the
>>packages at pythonmac.org. I started that because an earlier Python
>>2.4 matplotlib package crashed when using a user-installed Tcl/Tk*
>>and just never got out of the habit.
>>
>>So I don't have anything to do with the official matplotlib Mac
>>binaries and I have no idea what's in their ReadMe files. I *hope*
>>they include the necessary info about what version of wxPython is
>>required and all that, but I don't know.
>>
>>I can't help you with easy_install either. Sorry.
>>
>
>Well that explains why there is no readme in the distribution on source forge.
>Any chance you will build a distribution of matplotlib 0.90 for 
>pythonmac soon?

I did earlier today; I'm hoping it will go up in the next day or so.

WXAgg is built against wxPython 2.6.x because last I heard the 2.8.x 
issues weren't resolved.

-- Russell

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] ANN: matplotlib-0.90.0

2007-02-21 Thread Russell E Owen
At 9:42 AM -0800 2007-02-21, Chris Barker wrote:
>Russell E Owen wrote:
>
>>I did earlier today; I'm hoping it will go up in the next day or so.
>>
>>WXAgg is built against wxPython 2.6.x because last I heard the 
>>2.8.x issues weren't resolved.
>
>Correct. I'm still not sure how well MPL works with wxPython2.8 on 
>other platforms, but no one has fixed the issues on OS-X yet. There 
>is something weird with toolbars with wxPython2.8, I've run into 
>that with some other code, so it may even take a new release of 
>wxPython to get it all right...

Thank you for the update.

FYI: matplotlib 0.90.0 for Python 2.5 is now available at 
<http://pythonmac.org/packages>. I did not build a version for Python 
2.4.

Regards,

-- Russell

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Intermittent Matplotlib crash on OS X

2007-02-21 Thread Russell E. Owen
In article <[EMAIL PROTECTED]>,
 Anand Patil <[EMAIL PROTECTED]> wrote:

> >>Matplotlib occasionally crashes Python at the end of a long program on 
> >>my powerbook g4 running OS X 10.4. gdb output follows:
> >>
...
> It's Python 2.5, and the new Matplotlib 0.9 built from source. I saw the 
> same problem with Python 2.4.3 and Matplotlib 0.8.(can't remember), 
> which was part of the reason I upgraded. However, I didn't look at the 
> problem with gdb using the earlier versions.

Could you please try the matplotlib 0.90.0 binary for Python 2.5 from 
 and let us know if that also has the 
problem?

Also, could this be a memory leak? You may want to watch Activity 
Monitor or top while running your program.

If you do still have problems it might help to know a few more things 
including:
- which Python 2.5? (MacPython? fink? ActiveState?...)
- which back end and which numerix (and have you tried any other 
combinations?)

If that solves the problem then you may want to review instructions for 
building matplotlib for MacOS X, e.g.:


-- Russell


-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Anyone using TkAgg on OS X successfully

2007-05-07 Thread Russell E. Owen
In article <[EMAIL PROTECTED]>,
 "Samuel M. Smith" <[EMAIL PROTECTED]> 
 wrote:

> Anyone using TkAgg on OSX 10.4 with MPL 0.90.0 and Python 2.5  
> successfully?

Absolutely. I use the package at  (which 
I also built). One quirk is that I use ActiveState Aqua Tcl/Tk (8.4.11) 
rather than Apple's built-in Tcl/Tk. But it should work either way.

What problems are you having?

-- Russell


-
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Anyone using TkAgg on OS X successfully

2007-05-07 Thread Russell E Owen
At 2:30 PM -0600 2007-05-07, Samuel M. Smith wrote:
>If you see my other post titled (Segmentation Fault TkAgg backend). 
>I was getting a seg fault
>It appears to be a problem with the MPL in the scipy superpack. When 
>I reinstalled your package it
>worked again. The reason I installed the scipy superpack was it was 
>the only package installer for scipy.
>Any chance of you posting a package installer of scipy?

I'm afraid it's not likely, at least not in the near term. I don't 
really need scipy (though it would be handy at times) and work is 
keeping me busy on other tasks.

-- Russell

-
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] matplotlib 0.90.1 binary installer for Mac

2007-06-04 Thread Russell E. Owen
I've built a binary installer for matplotlib 0.90.1 for Mac that 
includes support for:
- TkAgg that works with a user-installed Aqua Tcl/Tk (unlike the 
standard build) or the standard old Tcl/Tk from Apple
- WXAgg using wxPython 2.8.

I've only checked WXAgg and TKAgg on my PPC Mac. If anyone could test it 
on an Intel Mac I would be grateful.

For now you can get it here:


In the long run it will be available here:


-- Russell

P.S. Build instructions are here:



-
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] CVS ?

2007-10-01 Thread Wayne E. Harlan
I have a serious problem with my Linux installation of matplotlib.  It 
segfaults after a very brief display of a plot window outline (no actual 
plot within it).  Before presenting the details of my problem, I would 
like to download the latest CVS version to make sure this hasn't been 
fixed already, however I cannot find any references to CVS in any of the 
Matplotlib web pages, except for a reference for it in one of the recent 
emails in this list.  How do I find it ?

Thanks in advance,

Wayne

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


Re: [Matplotlib-users] CVS ?

2007-10-02 Thread Wayne E. Harlan

Eric Firing wrote:
If a straightforward plotting sequence, such as one of the examples, 
does this, then it sounds like a broken installation, not a matplotlib 
bug.



Based on your comment above, here are my particulars:

1)  System is LinuxFromScratch recently built from their SVN book:
   glibc is 2.5, gcc is 4.1.2, X is Xorg 7.2 installed in /usr.

2)  Python 2.5.1 with Tkinter enabled.   If I run the following script, 
I get the 'quit' button which when clicked makes the button/window 
disappear, so I know python and Tkinter are working.


#!/usr/bin/python
from Tkinter import *
class Application(Frame):
   def __init__(self, master=None):
   Frame.__init__(self, master)
   self.grid()
   self.createWidgets()
   def createWidgets(self):
   self.quitButton = Button ( self, text="Quit",command=self.quit )
   self.quitButton.grid()
app = Application()
app.master.title("Sample application")
app.mainloop()

3)  Numpy 1.0.3.1 installed without any errors and I can do the following:

>>> import numpy
>>> List = dir(numpy)
>>> len(List)
491
>>>

4)  Matplotlib 0.90.1 also installed without error.  I set 
BUILD_TKAGG   = 1 which may not have been necessary, but it seems to 
have worked since in my matplotlibrc file I find "backend  : 
TkAgg".  Then if I do this
" python simple_plot.py --verbose-debug",  I get the output in the 
simple_output attachment.  The font errors there are the same as what I 
get in each of my 3 XP installations where matplotlib works just fine, 
so I don't think they are the cause of the segfault.  As I may have 
described previously, the plot window appears for a fraction of a second 
and then disappears as the segfault occurs.


I also ran "strace python simple_plot.py --verbose-debug" with the 
output that's in the strace_output attachment to see if that would give 
any more information but that output ends at the segfault and I am not 
knowledgeable enough to understand what it says.


Any help will be appreciated.

Best Regards,

Wayne

[EMAIL PROTECTED] ~/Programming/Python/matplotlib/examples: python 
simple_plot.py --verbose-debug  
matplotlib data path /usr/lib/python2.5/site-packages/matplotlib/mpl-data
$HOME=/home/wayne
CONFIGDIR=/home/wayne/.matplotlib
loaded rc file /home/wayne/.matplotlib/matplotlibrc
matplotlib version 0.90.1
verbose.level debug
interactive is False
units is True
platform is linux2
loaded modules: ['pylab', 'distutils.distutils', '_bisect', '__future__', 
'copy_reg',
 'sre_compile', 'distutils', 'itertools', '_hashlib', '_sre', '__main__', 
'site', '__
builtin__', 'datetime', 'matplotlib.re', 'matplotlib.tempfile', 'encodings', 
'encodin
gs.encodings', 'shutil', 'distutils.string', 'dateutil', 'matplotlib.datetime', 
'posi
xpath', '_random', 'tempfile', 'errno', 'matplotlib.warnings', 'binascii', 
'encodings
.codecs', 'sre_constants', 're', 'matplotlib.md5', 'os.path', 'pytz.sys', 
'_codecs', 
'distutils.sysconfig', 'pytz.sets', 'math', 'fcntl', 'stat', 'zipimport', 
'string', '
warnings', 'encodings.types', 'UserDict', 'encodings.ascii', 'matplotlib.sys', 
'matpl
otlib', 'distutils.os', 'sys', 'pytz.tzinfo', 'pytz', 'pytz.datetime', 
'matplotlib.__
future__', 'codecs', 'distutils.re', 'matplotlib.pytz', 'types', 'md5', 
'_types', 'ma
tplotlib.dateutil', 'hashlib', 'matplotlib.os', 'thread', 'bisect', 
'matplotlib.distu
tils', 'signal', 'distutils.errors', 'random', 'linecache', 
'matplotlib.shutil', 'pos
ix', 'encodings.aliases', 'sets', 'exceptions', 'sre_parse', 'pytz.bisect', 
'distutil
s.sys', 'os', 'strop']
numerix numpy 1.0.3.1
font search path 
['/usr/lib/python2.5/site-packages/matplotlib/mpl-data/fonts/ttf', '
/usr/lib/python2.5/site-packages/matplotlib/mpl-data/fonts/afm']
trying fontname 
/usr/lib/python2.5/site-packages/matplotlib/mpl-data/fonts/ttf/VeraMo
BI.ttf
trying fontname 
/usr/lib/python2.5/site-packages/matplotlib/mpl-data/fonts/ttf/VeraSe
.ttf
trying fontname 
/usr/lib/python2.5/site-packages/matplotlib/mpl-data/fonts/ttf/cmmi10
.ttf
trying fontname 
/usr/lib/python2.5/site-packages/matplotlib/mpl-data/fonts/ttf/VeraSe
Bd.ttf
trying fontname 
/usr/lib/python2.5/site-packages/matplotlib/mpl-data/fonts/ttf/cmsy10
.ttf
trying fontname 
/usr/lib/python2.5/site-packages/matplotlib/mpl-data/fonts/ttf/VeraIt
.ttf
trying fontname 
/usr/lib/python2.5/site-packages/matplotlib/mpl-data/fonts/ttf/cmr10.
ttf
trying fontname 
/usr/lib/python2.5/site-packages/matplotlib/mpl-data/fonts/ttf/cmex10
.ttf
trying fontname 
/usr/lib/python2.5/site-packages/matplotlib/mpl-data/fonts/ttf/cmtt10
.ttf
trying fontname 
/usr/lib/python2.5/site-packages/matplotlib/mpl-data/fonts/ttf/Vera.t
tf
loaded ttfcache file /home/wayne/.matplotlib/ttffont.cache
backend TkAgg version 8.4
findfont failed Bitstream Vera Serif, New Century Schoolbook, Century 
Schoolb
ook L, Utopia, ITC Bookman, Bookman, Nimbus Roman No9 L, Times New Roman, 
Times, Pala
tino, Charter, serif
Could not match Bitstream Vera Serif, New Century Schoolbook

Re: [Matplotlib-users] CVS ?

2007-10-03 Thread Wayne E. Harlan



Eric Firing wrote:

Wayne,

I'm stumped.  Do you get a segfault only with the gui backend?  Can 
you  you do this:


import matplotlib
matplotlib.use('Agg')
import pylab
pylab.plot([1,2,3])
pylab.savefig('test.png')

Eric



OK, this worked.  I have attached the test,png file that resulted.  But 
I don't quite know what this means ...


IDLE 1.2.1 
>>> import matplotlib

>>> matplotlib.use('Agg')
>>> import pylab
>>> pylab.plot([1,2,3])
[]
>>> pylab.savefig('test.png')
>>>

The other suggestion from Michael about using gdb will have to wait 
until I download, install and learn to use it, but if that's required, 
that's what I'll do.


Thanks

Wayne

<>-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] CVS ?

2007-10-03 Thread Wayne E. Harlan
Eric:

First thanks for all the help.  Here's the scoop after I replied to your 
earlier post.  I thought a bit about the sense of where you were going 
(it always helps to think a bit).  So I decided to try compiling 
matplotlib with the GTK backend instead of Tk.  I have gtk-2.11.5.   So 
I did some sed's to the setup.py file:

sed -i "s|BUILD_GTKAGG   = 'auto'|BUILD_GTKAGG  = 1|" setup.py &&
sed -i "s|BUILD_GTK  = 'auto'|BUILD_GTK = 1|" setup.py &&
sed -i "s|BUILD_TKAGG= 'auto'|BUILD_TKAGG   = 0|" setup.py &&

and then proceeded.  It turned out that I needed pygtk, so I downloaded 
that and installed it, but pygtk still complained about not having 
pycairo (which it says is optional), so I downloaded that.  Making a 
long story short, installing pycairo-1.4.0, pyobject-2.14.0, 
pygtk-2.10.6 and then reinstalling matplotlib with the above sed's did 
the trick.  I'm displaying all the plots I have been able to in XP (so I 
don't need XP any more, at least at home).

Once again, thanks for the suggestions.  Although I'm set here, I wonder 
about the tcl/tk issue with matplotlib.  I am using tcl/tk-8.4.15.  I 
wonder if it's too new ?  Or is there some other package that is needed ?

Wayne



Eric Firing wrote:
> Wayne,
>
> Segfaults are generally caused by problems in extension code or 
> libraries.  The fact that the plotting works with a non-gui backend 
> indicates that the problem is not in matplotlib's transform or Agg 
> extension code, or in the bits of numpy code that get used along the 
> way.  I was pretty sure this would be the case; all of those 
> components are solid and well-tested together, at least for simple 
> plotting.
>
> That tends to throw suspicion on Tkinter/Tk/Tcl or one of mpl's 
> extension bits that is run with Tk.  I'm not sure there are any in 
> this case.
>
> One way to narrow it down is to try another gui: gtk or qt.  Do you 
> have either of these libraries installed?
>
> Eric
>
> Wayne E. Harlan wrote:
>>
>>
>> Eric Firing wrote:
>>> Wayne,
>>>
>>> I'm stumped.  Do you get a segfault only with the gui backend?  Can 
>>> you  you do this:
>>>
>>> import matplotlib
>>> matplotlib.use('Agg')
>>> import pylab
>>> pylab.plot([1,2,3])
>>> pylab.savefig('test.png')
>>>
>>> Eric
>> 
>>
>> OK, this worked.  I have attached the test,png file that resulted.  
>> But I don't quite know what this means ...
>>
>> IDLE 1.2.1 >>> import matplotlib
>>  >>> matplotlib.use('Agg')
>>  >>> import pylab
>>  >>> pylab.plot([1,2,3])
>> []
>>  >>> pylab.savefig('test.png')
>>  >>>
>>
>> The other suggestion from Michael about using gdb will have to wait 
>> until I download, install and learn to use it, but if that's 
>> required, that's what I'll do.
>>
>> Thanks
>>
>> Wayne
>>
>>
>> 
>>
>
>

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] [Fwd: Re: CVS ?]

2007-10-06 Thread Wayne E. Harlan
Eric Firing wrote:

> The TkAgg backend works on my system, stock ubuntu feisty with only 
> numpy and mpl from svn.  tk/tcl is 8.4.
>
> Eric
>
Eric:

My processor is a 32 bit Athlon from about 5 or 6 years ago.  The 
Tkinter was built along with python and I did one particular sed:

sed -i 's|#-ltk8.2 -ltcl8.2|-ltk8.4 -ltcl8.4|' Setup.dist

so python would look for the version of tcl/tk that I have.  I'll review 
that whole process later and report back if I find something interesting.


Just want to follow up with you on the results.  Since my Xorg 7.2 is 
installed in /usr, I found that the original installation of Python and 
Tkinter needed some changes to Modules/Setup.dist.  I used the following
sed's:

sed -i 's|# _tkinter| _tkinter|' Setup.dist  ---to enable tkinter
sed -i 's|# -L/usr/local|   -L/usr|' Setup.dist  ---to locate tcl/tk libs
sed -i 's|# -I/usr/local|   -I/usr|' Setup.dist  ---to locate tcl/tk headers
sed -i 's|# -L/usr/X11R6|   -L/usr|' Setup.dist  ---to locate X11 libs
sed -i 's|# -I/usr/X11R6|   -I/usr|' Setup.dist  ---to locate X11 headers
sed -i 's|# -ltk8.2 -ltcl8.2|   -ltk8.4 -ltcl8.4|' Setup.dist  ---for 
correct version
sed -i 's|# -lX11|  -lX11|' Setup.dist  ---required to build tkinter

So I completely removed python, numpy, mpl, etc and reinstalled everything, 
including the GTK requirements that got me going last time.  The installed 
matplotlibrc called for the GTKAgg backend and that worked.  But when I changed
that to call for TkAgg, the same thing happened as last time (the window appears
briefly and then segfaults).  So I'm puzzled but at least I have a working 
installation with GTK.

Thanks,

Wayne


-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Problem with .png files?

2007-10-07 Thread Wayne E. Harlan
Bill:

I do not have that problem using mpl-0.90.1 or svn which I checked out 
and installed yesterday.  I have gimp-2.2.17 and have no problems 
opening them on my linux system or my two XP systems at work.  The issue 
I do find is that when I specify the DPI in the savefig command, it does 
not properly get encoded into the png, although the size of the graphic 
is set accordingly.  So maybe that is a clue to what's happening to 
you.  You are saving them as "something.png", right ?

Wayne

Bill Dandreta wrote:
> There appears to be a problem with .png files that matplotlib creates. 
> Some programs (like GIMP  and xv) 
>  do not identify them as png files and 
> cannot display them.
>

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Problem with .png files?

2007-10-07 Thread Wayne E. Harlan
I would like to follow up on my first response to Bill.  It probably 
should be a new thread, but I'll start here.  When png files are saved 
with a DPI=300 argument, and I open them in the Gimp, the dpi is only 72 
(default ?).  As I understand it, the dpi setting in the graphics file 
tells the application opening it how big to display it.  When I use 
savefig with a DPI=300 and the plot figure I am saving was created with 
figsize=(6,4.5) I expect the figure to open in word or swriter at the 
size I specified (6" by 4.5") with the appropriate number of pixels.  
However, at present, that does not happen.  The number of pixels in the 
figure is correct but I have to resize it manually to get the right 
size.  Can this be fixed ?

Thanks,

Wayne

Bill Dandreta wrote:
> I resolved the problem. It was unrelated to mpl. xv and gimp were
> complied w/o png support. Recompiling with png support resolved the problem.
>
>   

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Problem with .png files?

2007-10-08 Thread Wayne E. Harlan
Not quite.  The figure opens at the correct size in the gimp but all I 
see is background - no plot stuff.

Wayne

Michael Droettboom wrote:
> This is now added in SVN, and only for the Agg backend(s).  It won't 
> work with some of the other ways to save PNG files, such as Gdk, Wx 
> (non-Agg) and Cairo.  If anyone was any thoughts about how to support 
> saving the resolution in those backends, please share.
>
> Also note that resolution is saved in "dots per meter" in PNG files, 
> so rounding error makes things slightly off -- for instance, 100 dpi 
> is shows up as 99.98 dpi in the GIMP.
>
> Cheers,
> Mike
>
> Michael Droettboom wrote:
>> I'll look into this.  I actually made a similar fix on another 
>> project I used to work on...  It should be theoretically possible, 
>> barring any roadblocks from how matplotlib is doing things.
>>
>> Cheers,
>> Mike
>>
>> Wayne E. Harlan wrote:
>>> I would like to follow up on my first response to Bill.  It probably 
>>> should be a new thread, but I'll start here.  When png files are 
>>> saved with a DPI=300 argument, and I open them in the Gimp, the dpi 
>>> is only 72 (default ?).  As I understand it, the dpi setting in the 
>>> graphics file tells the application opening it how big to display 
>>> it.  When I use savefig with a DPI=300 and the plot figure I am 
>>> saving was created with figsize=(6,4.5) I expect the figure to open 
>>> in word or swriter at the size I specified (6" by 4.5") with the 
>>> appropriate number of pixels.  However, at present, that does not 
>>> happen.  The number of pixels in the figure is correct but I have to 
>>> resize it manually to get the right size.  Can this be fixed ?
>>>
>>> Thanks,
>>>
>>> Wayne
>>>
>>> Bill Dandreta wrote:
>>>> I resolved the problem. It was unrelated to mpl. xv and gimp were
>>>> complied w/o png support. Recompiling with png support resolved the 
>>>> problem.
>>>>
>>>>   
>>> - 
>>>
>>> This SF.net email is sponsored by: Splunk Inc.
>>> Still grepping through log files to find problems?  Stop.
>>> Now Search log events and configuration files using AJAX and a browser.
>>> Download your FREE copy of Splunk now >> http://get.splunk.com/
>>> ___
>>> Matplotlib-users mailing list
>>> [email protected]
>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Margin are too wide

2007-10-17 Thread Wayne E. Harlan
First you should look at the axes() command with its arguments to 
control the boundaries of the plot area inside the figure.  I always use 
this to maximize the use of the figure space.  I'm not sure, though, 
whether this works with the kind of plot you want.  Check it out.  The 
other thing that is related is the aspect ratio of the plot.  A pie 
chart will only fill up as far as the shortest dimension available, so 
from your attachment you might try increasing the height or decreasing 
the width.

Wayne

Romain Bignon wrote:
> Hello,
>
> When I create a graph, margin is too wide. How can I reduce this?
>
> There is an example with this mail.
>
> Thanks.
>
>   
>
> 
>
> 
>
> -
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems?  Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >> http://get.splunk.com/
> 
>
> ___
> Matplotlib-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>   

-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] eggs or pythonmac packages on OS X?

2007-12-04 Thread Russell E. Owen
In article 
<[EMAIL PROTECTED]>,
 "Stephen Uhlhorn" 
 <[EMAIL PROTECTED]> wrote:

> I'm running MacPython 2.5 on Mac OS 10.5.1 and would like to update
> matplotlib to 0.91.1. Im using mpl 0.90.1 from the pythonmac site now.
> Is it better for me to wait till a pythonmac package is availabel or
> are the eggs on SF good to use. I would favor the SF eggs because of
> ease of upgrading unless there are some OS X conflicts I'm unaware of.

If you use Tcl/Tk and use a current version (instead of the ancient 
version that is built in) then use the packages at pythonmac. I just 
built 0.91.1 today and it should show up there soon. Meanwhile you can 
get it from here:


I hope that someday the official Mac egg version will work with 3rd 
party Tcl/Tk but no version I've tried has -- including 0.91.1.

> If I use the eggs, what's the best way to safely uninstall the
> pythonmac package? Just delete the relevant site-packages durectory?

That's what I do, but I'm not sure it's the best way. I delete all 
folders whose names start with "matplotlib" (usually a folder named 
"matplotlib" and another named matplotlib-xxx-py2.5.egg-info)

-- Russell


-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] eggs or pythonmac packages on OS X?

2007-12-05 Thread Russell E Owen
At 10:03 AM -0800 2007-12-05, Christopher Barker wrote:
>Russell E Owen wrote:
>>At 10:08 AM -0500 2007-12-05, Stephen Uhlhorn wrote:
>>>Just for my edification, why can't the egg version be linked
>>>against/include a different Tcl/Tk?
>>
>>If you mean why can't it be built that way in the first place, I 
>>don't know. The guy who builds it apparently doesn't read this list,
>
>Sure he does (if you mean the matplotlib list), and he did ask about 
>it right before this release. Maybe that was asked on 
>matplotlib-devel though (I filter them to the same place).

It was on matploblib-devel. I'll start skimming that newsgroup.

>>I suspect the official egg can somehow be patched, but I find it 
>>easier to just build my own and put that on pythonmac.
>
>Ideally, there would be only one binary version, and it would work 
>with either Tcl/Tk. Is that possible? or is this like the old wx 
>situation, where it  can only be run with the same version it is 
>built against. Arrggg! I hope not.

The version I build *can* be used with the built in Tcl/Tk. The 
version Charlie Moad builds cannot be used with TkAgg and a 3rd party 
Tcl/Tk -- it not only won't use the library, but it also acts flaky. 
Older versions crashed. 0.91.1 doesn't crash, but import of pylab 
fails with a traceback.

For some reason it seems to be necessary to have a 3rd party Tcl/Tk 
installed when building matplotlib. It seems a shame. Tkinter in 
Python 2.4 was the same way, but that got fixed in Python 2.5 (I 
don't whether the installer got fixed or whether whoever builds Mac 
Python 2.5 installed a 3rd party Tcl/Tk).

>If there really do need to be two, then they should be labeled 
>somehow, and both be up on python mac.

Since there don't need to be two versions this is not necessary.

However, Charlie Moad appears to be willing to start building a 
version that works with 3rd party Tcl/Tk. I really hope that happens.

-- Russell

-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] eggs or pythonmac packages on OS X?

2007-12-05 Thread Russell E Owen
At 10:08 AM -0500 2007-12-05, Stephen Uhlhorn wrote:
>On Dec 4, 2007 5:14 PM, Russell E. Owen <[EMAIL PROTECTED]> wrote:
>
>>  If you use Tcl/Tk and use a current version (instead of the ancient
>>  version that is built in) then use the packages at pythonmac. I just
>>  built 0.91.1 today and it should show up there soon. Meanwhile you can
>>  get it from here:
>>  <http://www.astro.washington.edu/rowen/pythoninstallers/>
>>
>>  I hope that someday the official Mac egg version will work with 3rd
>>  party Tcl/Tk but no version I've tried has -- including 0.91.1.
>
>Does this mean that the only difference between the egg and pythonmac
>version is how it's linked against Tcl/Tk?

I suspect you are right. But I only build the pythonmac version, not 
the official version, so I don't know for sure. I build my version 
using:
<http://www.astro.washington.edu/rowen/BuildingMatplotlibForMac.html>. 
I don't do anything special, but I do have a 3rd party Tcl/Tk 
installed before I build and that seems to make all the difference.

>Just for my edification, why can't the egg version be linked
>against/include a different Tcl/Tk?

If you mean why can't it be built that way in the first place, I 
don't know. The guy who builds it apparently doesn't read this list, 
and I understand he's on some mailing list that I don't subscribe to.

I suspect the official egg can somehow be patched, but I find it 
easier to just build my own and put that on pythonmac.

-- Russell

-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Problem installing 0.91.2 egg on OS X 10.4

2008-01-14 Thread Russell E. Owen
In article 
<[EMAIL PROTECTED]>,
 "Charlie Moad" <[EMAIL PROTECTED]> wrote:

> I have replaced the binary with a working version.

I'm running into an odd issue with that version (at least). If I unzip 
the egg and run easy_install on it it ends up in site-packages with odd 
permissions:
% pwd
/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-pack
ages
% ls -l
drwx-- 9 rowen  admin 306 Jan 14 16:59 
matplotlib-0.91.2-py2.5-macosx-10.3-fat.egg

The permissions inside look normal so this is easy to fix with chmod, 
but it seems strange. Any idea if I am doing something wrong or if 
something is wrong with the package?

-- Russell


-
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Subplot Questions

2008-01-30 Thread Wayne E. Harlan
Alan:

The figure size determines the eventual size of the figure where it will 
be displayed.  You should set that with "figsize=(x,y)" before you 
actually plot.  Then, and very importantly, you should set the DPI for 
the medium where you are viewing the figure.  A computer display will 
probably be between 75 and 100 DPI.  Then for good print quality, you 
should specify a DPI larger than that, say 300 or 350 or for some 
purists even to 800 when you use "savefig(...)".  Then the actual number 
of pixels is determined which will give the original figure size on the 
chosen display medium.  Note that more DPI means more pixels and a 
larger file.  This didn't work for me with an earlier version of mpl and 
after I posted that here, it was fixed so you should be using the latest 
version for the above to work.

HTH and cheers,

Wayne

Alan G Isaac wrote:
> On Mon, 28 Jan 2008, Manuel Metz apparently wrote:
>   
>> fig = pylab.figure(figsize=(6,10), dpi=96)
>> [...] 
>> pylab.savefig("filename.eps", dpi=96)
>> 
>
> A couple questions.
>
> 1. The help for figure says that the dpi argument
> determines the "resolution".  Suppose I am producing
> a PNG file for screen display: what am I changing
> when I change the dpi argument (from the point of
> view of the file, and from the point of viewer of
> the person viewing the file onscreen).  More generally,
> are there standard setting recommended for onscreen
> PNG figure display?
>
> 2. EPS is a vector format, and the fig has a size.
> What role does the dpi argument play here?
>
> Thank you,
> Alan Isaac
>
>
>
> -
> 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
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>   

-
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Subplot Questions

2008-01-31 Thread Wayne E. Harlan
Eric:
I have never seen any software which dealt with non uniform DPI 
settings, although that is always a possibility.  And all the displays I 
have ever worked on/with have been the same for both H and V.  ( I am a 
display engineer with over 25 years experience in CRT displays and a bit 
in flat panel).  From what I have seen, the RGB trio in any display is 
set up so that the horizontal pitch is the same as the vertical pitch.  
In a flat panel the R, G and B are 3 times taller than they are wide so 
that when you place R, G and B together they form a square.  I don't 
think that Matplotlib or Alan needs to worry about anything outside 
those boundaries.

Wayne

Eric Firing wrote:
> John Hunter wrote:
>   
>> On Jan 31, 2008 12:54 AM, Eric Firing <[EMAIL PROTECTED]> wrote:
>>
>> 
>>> Screens vary.  The screen on my laptop has about 130 dpi. Desktop flat
>>> panels will usually have a smaller value than that.  For example, an old
>>> "15-inch" flat panel with 1024/768 pixels is actually about 12 inches
>>> wide, so dpi=85.  The mpl default 'figure.dpi' of 80 is low; I doubt
>>>   
>> And it is not unusual to have a different DPI in the horizontal and
>> vertical directions.  In order to support true physical sizes on the
>> screen, we would need to support different dpis in the two directions.
>> 
>
> Does any other software actually do this?  I have never seen anything 
> with more than a single dpi setting.  What is an example of a display 
> with non-square pixels?  And how non-square are they?  I suspect this is 
> not something that Alan really needs to worry about.
>
> Eric
>
> -
> 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
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>   

-
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] dashes and dpi?

2008-02-02 Thread Wayne E. Harlan


Mark Bakker wrote:
> Yet here you claim that 1pt = 1/72 inch.
> Is that always the case?
Kind of.  This is a typesetting measurement originally having nothing to 
do with computers, displays or graphics files.  However at Wikipedia 
they say its definition has changed over time.
http://en.wikipedia.org/wiki/Point_%28typography%29


-
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] segfault with Tkagg

2008-02-27 Thread Wayne E. Harlan
I have had a similar problem here with python-2.5.1, numpy-1.0.4 and 
mpl-0.91.2 all installed on my linux (from scratch) system.  I reported 
this last year but ending in a dead end with no one being able to help.  
My --verbose-debug_annoying output seemed to indicate it had something 
to do with the loading of the fonts, like yours, but that's all the 
farther we all got.  My work around was to install the prerequisites for 
GtkAgg and go with that.  Everything works fine now using GtkAgg.

I even recently installed ATLAS using lapack so I could install numpy 
and scipy with their full functionality and was also successful doing 
that.  I'm able to do curve fitting and find roots of polynomials.  So I 
believe the TkAgg backend does have some incompatibilities but no one 
has a clue as to why.  Otherwise, it's all smooth sailing doing it all 
from scratch.

Take Good Care,

Wayne

LB wrote:
> I'm still investigating for my segmentation fault pb with matplotlib 
> and Tkagg,
> but now, I have no more idea.
>

-
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Zorder Problem with twinx()

2008-03-05 Thread Wayne E. Harlan
First, I apologize for the long script.  It's if anyone wants to see the 
issue first hand.  The problem is that when I use twinx() to plot two 
different functions on the same axes, the legend from the first part is 
overwritten by the grid lines of the second part (after the twinx() 
statement).  As you can see in the Plot function, I tried to use the 
zorder to have the first legend drawn at the end but that doesn't work.  
I can see two possibilities -


1)  I still don't know how to use zorder, or ...

2)  the twinx() statement somehow causes the zorder process to get reset 
so that the first legend always gets drawn before the second function is 
plotted.


Thanks for any help,

Wayne
#FilterPlot.py

from pylab import *

pico,micro,meg,gig = 1e-12,1e-6,100.,1.E9
NumPts,SaveFile = 2**10,1

def MakeTicks(Low,High,fudge=0):
   K,up,down,Ticks,Inc = 1.,10.,0.1,[],1.
   while (High-Low) <= up:
  High,Low = High*up,Low*up
  K *= up
   while (High-Low) >= up*up:
  High,Low = High*down,Low*down
  K *= down
   if int(fudge):  High += (High-Low)*.05
   Delta,Inc = High-Low,2.
   if Delta > 20.:   Inc = 5.
   if Delta > 55.:   Inc = 10.
   I,inc,Min,Max = 0,Inc/K,Low/K,High/K
   Ticks.append(inc*float(int(Low/Inc)))
   if Ticks[0] > Min:  Ticks[0] -= inc
   while Ticks[-1] <= Max:
  I += 1
  Ticks.append(Ticks[0]+float(I)*inc)
   return Ticks

def Step(Input,df):
   t,v,dt,Out = [],[],1./(2.*NumPts*df),0.
   for I in range(0,len(Input)/4,1):
  t.append(float(I)*dt*1000.)
  Out += Input[I].real
  v.append(Out)# integrate impulse response
   return [t,v]

def Impulse(Input,df):
   t,v,dt,Out = [],[],1./(2.*NumPts*df),0.
   for I in range(0,len(Input)/4,1):
  t.append(float(I)*dt*1000.)  # so the time scale is in nanoseconds
  v.append(Input[I].real*1000.)
   return [t,v]

def TransFcn(Rs,C1,L2,C3,L4,C5,Name,Resp=0):
   B = [1.]
   B.append(Rs*(C1+C3+C5))
   B.append(L2*C3+(L4+L2)*C5)
   B.append(Rs*(L2*C1*(C3+C5)+L4*C5*(C1+C3)))
   B.append(L2*L4*C3*C5)
   B.append(Rs*L2*L4*C1*C3*C5)   #for K in range(6):  print 'D['+str(K)+'] = 
',D[K]
   Mag,Arg,Dly,Freq,Xfer,f,unwrap = [],[],[],[],[],0.,0.
   Fmax = round(16.*B[0]/(B[1]*meg),0)# Want it in MHz (100 nsec -> 160 MHz)
   df = Fmax/float(NumPts)
   while f < Fmax:# Gives a sequence length of NumPts
  Freq.append(f)
  w = 2.*pi*f*meg # w in radians/sec
  w2 = w*w
  w4 = w2*w2
  Re,Im = B[0]-w2*B[2]+w4*B[4],w*(B[1]-w2*B[3]+w4*B[5])
  cpx = 1./complex(Re,Im)
  mag,arg = abs(cpx),-arctan2(Im,Re)
  Xfer.append(cpx)# For fft submission
  Mag.append(mag)
  Arg.append(180./pi*arg)
  Dly.append(gig*((B[1]-3.*w2*B[3]+5.*w4*B[5])*Re \
 + w*(2.*B[2]-4.*w2*B[4])*Im)/(Re*Re+Im*Im))  # nanoseconds
  f += df
   PlotFile = 'FilterResponse.png'
   Plot(Freq,Xfer,Mag,Dly,Name,Resp,df)
   if SaveFile:
  savefig(PlotFile,dpi=300,facecolor='w',edgecolor='w')

def Plot(Freq,Xfer,Mag,Dly,Name,Resp,df):
   RespType,Which = {0:'Impulse',1:'Step'},{0:Impulse,1:Step}
   K = NumPts/8   # To expand interesting portion
   Freq,Mag,Dly = Freq[:K],Mag[:K],Dly[:K]
   xLabel,yLabel1,yLabel2 = 'Frequency (MHz)','Magnitude','Delay (nsec)'
   Haxis = MakeTicks(Freq[0],Freq[-1],0)
   PlotTitle = Name + ' Transfer Function'
   PlotList1,PlotList2 = ['Mag'],['Delay']
   figure(figsize=(6,4.5),facecolor='w',dpi=100)
   axes([.095,.09,.80,.85],axisbg='1.0')
   grid(True,ls='-',color=(0.,0.,.65),alpha=0.5,lw=.35)
   plot(Freq,Mag,'b-',lw=1.0)
   Vaxis = MakeTicks(min(Mag),max(Mag),1)
   axis([Haxis[0],Haxis[-1],Vaxis[0],Vaxis[-1]])
   title(PlotTitle)
   ylabel(yLabel1)
   xticks(Haxis)
   yticks(Vaxis)
   l1 = legend(PlotList1,loc=(.76,.92))
   l1.zorder = 99
   m1 = l1.get_frame()
   m1.set_linewidth(0)
   m1.set_facecolor('0.95')
   twinx()
   g2 = grid(True,ls='-',color=(.65,0.,0.),alpha=0.5,lw=.35)
   #g2.zorder = 0   This gives an error
   plot(Freq,Dly,'r-',lw=1.0)
   Vaxis = MakeTicks(min(Dly),max(Dly),1)
   axis([Haxis[0],Haxis[-1],Vaxis[0],Vaxis[-1]])
   xlabel(xLabel)
   ylabel(yLabel2)
   xticks(Haxis)
   yticks(Vaxis)
   l2 = legend(PlotList2,loc=(.76,.86))
   l2.zorder = 100
   m2 = l2.get_frame()
   m2.set_linewidth(0)
   m2.set_facecolor('0.95')

def Main():
   Rs = float(1000)
   C1,C3,C5 = pico*float(6.67),pico*float(31),pico*float(62.3)
   L2,L4 = micro*float(19.5),micro*float(42.1),
   TransFcn(Rs,C1,L2,C3,L4,C5,'Bessel',1)
   show()

try:
   Main()
finally:
   print '\'FilterPlot.py\' is finished.'
-
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
[email protected]
https://lists.sour

Re: [Matplotlib-users] compiling from svn on windows

2008-03-21 Thread Wayne E. Harlan
Chris:

I have used cygwin to compile numpy and scipy svn versions for win XP on 
my old athlon system.  I believe the scipy site has some detailed 
instructions.  However, I have done a lot of compiling on my linux 
system and so that part was easy (configure, make, make install, etc)  I 
don't know about mpl but scipy for sure was very sensitive to the 
platform and the stock scipy distro blew up big time doing curve fitting 
optimizations.  Compiling my own versions made those problems go away, 
thankfully.  You can download cygwin and install it easily enough but 
then you need to pick which of the included programs to install and that 
is a pain unless you have disk space and can do everything. 

For numpy and scipy I did the following in the cygwin prompt after 
cd-ing to where I keep my sources:

  "/cygdrive/c/python25/python.exe setup.py config --compiler=mingw32 
build \
 --compiler=mingw32 bdist_wininst " and this produced a windows .exe 
installer.

I tried mpl last night and it failed due to some dependencies, I think 
it was freetype that was missing and I couldn't satisfy the requirements 
but maybe someone on the list can enlighten us.  With that taken care 
of, it should be straightforward.

Wayne

Chris Withers wrote:
> Michael Droettboom wrote:
>   
>>> That's cool'n'all, but when is svn going to make it into a Windows 
>>> binary release? ;-)
>>>   
>>>   
>> I suspect your question is somewhat rhetorical, but...  it will probably 
>> be a while ;) 
>> 
>
> Why is that? Who cranks out the binary releases on Windows and what 
> compiler do they use?
>
>   
>> I know a lot of people (myself included) have had success with MinGW.  
>> 
>
> What's the "official" compiler used, though?
>
>   
>> It's a good learning experience, and there's lots on this list willing 
>> to help.  If we can get more SVN Windows users on board, more crazy 
>> Windows-only bugs will get found and squashed sooner... ;)
>> 
>
> Well, tell me how to get the svn trunk and how to compile and I'll give 
> it a go :-)
>
> cheers,
>
> Chris
>
>   

-
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Question about the data path

2006-06-02 Thread Russell E. Owen
I'm using matplotlib in an application I distribute. For Windows and Mac 
users I distribute a frozen application which includes python, 
matplotlib, etc. and I'm wondering how best to include the matplotlib 
data files.

matplotlib searches for its data files in __init__._get_data_path. It 
seems to search shared locations first, then locations that would be 
relevant to a frozen application. Is that safe? I worry that if a user 
of my app has their own version of matplotlib (possibly a very different 
version than I've included) then the data files might be different.

If this really is an issue, then what to do?

For Mac I can put the data files deep in the app in 
Contents/Frameworks/Python.Framework/2.4/share/matplotlib, which is the 
second location looked at (after environment variable MATPLOTLIBDATA).

For Windows, there doesn't seem any way out. The Windows frozen test is 
dead last.

---

Also, should I worry about the user's local matplotlibrc file (which 
again might be for the wrong version or might never have been created or 
configured at all -- the main problem I've hit so far is that the 
auto-created default of this file is always wrong about the back 
end--picking gtkagg even though I don't even build gtk support).

Again, that looks difficult or impossible because the search order is 
for the usual user locations first, then look in the data directory.

Any advice would be most appreciated.

-- Russell



___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Question about the data path

2006-06-05 Thread Russell E. Owen
In article 
<[EMAIL PROTECTED]>,
 "Charlie Moad" <[EMAIL PROTECTED]> wrote:

> On 6/2/06, Russell E. Owen <[EMAIL PROTECTED]> 
> wrote:
> > I'm using matplotlib in an application I distribute. For Windows and Mac
> > users I distribute a frozen application which includes python,
> > matplotlib, etc. and I'm wondering how best to include the matplotlib
> > data files.
> >
> > matplotlib searches for its data files in __init__._get_data_path. It
> > seems to search shared locations first, then locations that would be
> > relevant to a frozen application. Is that safe? I worry that if a user
> > of my app has their own version of matplotlib (possibly a very different
> > version than I've included) then the data files might be different.
> >
> > If this really is an issue, then what to do?
> 
> The only way you could have conflicting data sources is if
> MATPLOTLIBDATA is defined in your environment. 
> of setting that I am inclined to think they might know what to do in
> case of an error.  If that env var is not set, then mpl looks inside
> the its module.  Different installs will not see the others.  We
> finally have a special case for frozen installations.  It has
> primarily been made for py2exe, in which you should have a folder
> called 'matplotlibdata' in your app's bundle.

OK, thanks. I had not realized that so few dirs were searched on Windows 
as compared to unix/MacOS X, but you're right. So although the test for 
frozen windows versions comes last, there's not much to collide with 
before that.

> > For Mac I can put the data files deep in the app in
> > Contents/Frameworks/Python.Framework/2.4/share/matplotlib, which is the
> > second location looked at (after environment variable MATPLOTLIBDATA).
> 
> The second location should be:
> Frameworks/Python.Framework/2.4/lib/python2.4/matplotlib/mpl-data
> 
> Are you using an old version of matplotlib?

I guess it's a bit old. 0.82. I need something built for MacOS X 10.3.9 
so my bundled app runs on that.

Thanks for the heads up on the changed path. Maybe I'll remember to fix 
my bundling code when I upgrade matplotlib.

> > For Windows, there doesn't seem any way out. The Windows frozen test is
> > dead last.
> 
> You can remove the MATPLOTLIBDATA env var from os.environ in your code.

Great idea. I'll do that. Thanks!

> In my experience with distributing apps with matplotlib, I have known
> in advanced the packages I want to use.  For example, if I know I am
> going to bundle Tkinter and numpy, then I make sure I have the
> following before using any matplotlib commands.
> 
> import matplotlib
> matplotlib.use('TkAgg')
> matplotlib.rcParams['numerix'] = 'numpy'

Thanks for the tip. I knew about the first one, but not the second!

-- Russell



___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] crash on MacOS X

2006-09-15 Thread Russell E. Owen
I'm trying to figure out a matplotlib crash on MacOS X.

When I try to plot anything the program exits with:
alloc: invalid block: 0xa08acb4: a 74 0

I first saw this with a program that uses the object interface, but then 
I tried the simplest pylab demo I could find and the same thing happened.
Setup:
- matplotlib installed from the universal package at pythonmac.org
  configured to use numarray (1.5.1) and the TkAgg back end
- MacOS X 10.4.3 on a PPC mac
- ActiveState Aqua Tcl/Tk 8.4.13
- seen with two different versions of python:
  - ActiveState python 2.4.3 (PPC-only)
  - universal Python 2.4.3 (with _tkinter.so modified to find my Tcl/Tk)

Any ideas?

-- Russell


-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] crash on MacOS X (more info)

2006-09-15 Thread Russell E. Owen
In article <[EMAIL PROTECTED]>,
 "Russell E. Owen" <[EMAIL PROTECTED]> 
 wrote:

> I'm trying to figure out a matplotlib crash on MacOS X.
> 
> When I try to plot anything the program exits with:
> alloc: invalid block: 0xa08acb4: a 74 0
...
some followup info:
- This is with matplotlib 0.87.5, but also seen with 0.87.4 and 0.87.2
- This is with ActiveState Tcl/Tk 8.4.11, not 8.4.13 as I originally said

I tried the test again with "debug-annoying" level logging. Before 
running it I:
- deleted everything in ~/.matplotlibrc.
- .../site-packages/matplotlib/mpl-data to ~/.matplotlibrc and stripped 
out all but  a few options (something I'd never tried before, but I'm 
hoping it'll leave me a matplotlibrc file that is compatible with future 
versions of matplotlib, for a change):

backend  : TkAgg
numerix  : numarray 
interactive  : False
verbose.level  : debug-annoying
verbose.fileo  : sys.stdout

I then ran the test:
>>> from pylab import *
>>> plot([1,2,3,4])
>>> show()

The crash happens after the show():
...
RendererAgg.draw_text
RendererAgg._get_agg_font
alloc: invalid block: 0xa08acb4: a 74 0

The full log is here:
<http://rowen.astro.washington.edu/mpl.txt>

One other thing that may be relevant (and is in the log): whenever I run 
matplotlib for the first time after deleting the font cache, I always 
get a spate of warnings like this:
455: UserWarning: Could not open font file 
/System/Library/Fonts/LastResort.dfont

-- Russell


-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] crash on MacOS X

2006-09-15 Thread Russell E. Owen
In article <[EMAIL PROTECTED]>,
 Christopher Barker <[EMAIL PROTECTED]> wrote:

> Russell E Owen wrote:
> > Interesting idea. I'm not sure I'd know how to use more than one numerix 
> > option at once,
> 
> well, I dint' mean more than one numerix option, exactly. What I meant 
> was that MPL is using numarray, but another module you've imported is 
> using Numeric (or numpy or whatever).

Ah. I can guarantee that's happening. Some of my code uses Numeric (due 
to high speed on short arrays) and some uses numarray (because I started 
using it for all new code when it looked like it would take over). I 
hope to switch to numpy for everything once the dust settles, but I 
don't want to force my users to all move at once (a lot of them are on 
unix and will have to manually install numpy -- no big deal, but I get 
complaints every time I require a new package).

> ...Does it happen with wxAgg? or just plain ol Agg? also try the non-agg TK 
> back-end.

I don't have wx or gtk installed, so no easy way to test those backends.

It does not crash with plain old Agg (but of course I don't see any 
plot).

I'll be happy to try the "non-agg TK back-end" if you can tell me what 
setting to use for it. I didn't see it in the matplotlibrc's list of 
options (but WXAgg is also missing from that particular list), nor on 
the "Which backend should I use?" page.

> If not, then you've apparently found a tkAgg bug.
> 
> TK has always been a bit of a second-class citizen on the Mac -- why 
> haven't you switched to wx yet? ;-)

I started this project several years ago and at the time Tcl/Tk was the 
only game in town for Mac+unix+windows cross-platform support. 
Admittedly the Mac support was poor, but it has gotten much better, and 
I like Tkinter pretty well overall. It would be a major job to switch 
now and I doubt I can justify the expense and time. Sometimes I wish I'd 
used Java, even though the I strongly prefer Python, just to get a 
standard GUI.

I'm bulding matplotlib from source now, just to see if there might be 
some quirk about the installer package.

-- Russell


-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] crash on MacOS X

2006-09-18 Thread Russell E. Owen
In article <[EMAIL PROTECTED]>,
 Christopher Barker <[EMAIL PROTECTED]> wrote:

> Russell E Owen wrote:
> >> well, I didnt' mean more than one numerix option, exactly. What I meant 
> >> was that MPL is using numarray, but another module you've imported is 
> >> using Numeric (or numpy or whatever).
> > 
> > Ah. I can guarantee that's happening. Some of my code uses Numeric (due 
> > to high speed on short arrays) and some uses numarray (because I started 
> > using it for all new code when it looked like it would take over).
> 
> Then this could be it. In general, they should co-exist just fine, but 
> do know someone else has weird crashing problems when they were mixed 
> with MPL (and GDAL, in his case). Both numpy and Numeric, and numarray 
> have a lot of extension code that shares names, etc. who knows what 
> problem that can cause?
> 
>  > I
> > hope to switch to numpy for everything once the dust settles,
> 
> good plan, and it's getting close. The API should be stable now. The 
> sooner the better, I think. You'll be a lot more help with bugs or 
> potential bugs like this one.

I look forward to the unification, but unfortunately I don't think it 
will help with this crash (unless the very fact that the numarray and/or 
Numeric are installed but not loaded can cause problems).

I see the crash even with this trivial script:

$ python
>>> from pylab import *
>>> plot([1,2,3,4])
>>> show()
boom!

matplotlib 0.87.5 crashes with ~/.matplotlib/matplotlibrc set to use 
numarray (1.5.1), Numeric or numpy (1.0b5).

> > I don't have wx or gtk installed, so no easy way to test those backends.
> 
> if you install the mpkg on pythonmac.org/packages, wx should work. 
> that's pretty easy.

Fair enough. I installed wxPython (2.6) and the above scripts works fine 
(as long as interactive is false).

> > It does not crash with plain old Agg (but of course I don't see any plot).
> 
> Does it save a png successfully?

I can try this if you think it will help. It appears to be a lot more 
work than just slapping up a plot using pylab so I've not tried it yet.

I also failed to build matplotlib from source. I had all the 
prerequisites in /usr/local (and I reinstalled freetype 2.2.1 to be 
sure, since the version shown in /usr/local/lib has no resemblance to 
the source version). During the build I see these warnings (but no 
errors):

/usr/bin/ld: for architecture i386
/usr/bin/ld: warning /usr/local/lib/libpng.dylib cputype (18, 
architecture ppc) does not match cputype (7) for specified -arch flag: 
i386 (file not loaded)

and after installation, importation of pylab fails as follows:

>>> from pylab import *
Traceback (most recent call last):
  File "", line 1, in ?
  File 
"/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-pac
kages/pylab.py", line 1, in ?
from matplotlib.pylab import *
  File 
"/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-pac
kages/matplotlib/pylab.py", line 200, in ?
from axes import Axes, PolarAxes
  File 
"/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-pac
kages/matplotlib/axes.py", line 15, in ?
from axis import XAxis, YAxis
  File 
"/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-pac
kages/matplotlib/axis.py", line 25, in ?
from font_manager import FontProperties
  File 
"/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-pac
kages/matplotlib/font_manager.py", line 39, in ?
from matplotlib import ft2font
ImportError: Failure linking new module: 
/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-pack
ages/matplotlib/ft2font.so: Symbol not found: 
_FMDisposeFontFamilyIterator
  Referenced from: /usr/local/lib/libfreetype.6.dylib
  Expected in: flat namespace

-- Russell


-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] crash on MacOS X

2006-09-21 Thread Russell E Owen
At 3:12 PM -0700 9/15/06, Christopher Barker wrote:
>Russell E Owen wrote:
>>Interesting idea. I'm not sure I'd know how to use more than one 
>>numerix option at once,
>
>well, I dint' mean more than one numerix option, exactly. What I 
>meant was that MPL is using numarray, but another module you've 
>imported is using Numeric (or numpy or whatever).

Ah. I can guarantee that's happening. Some of my code uses Numeric 
(due to high speed on short arrays) and some uses numarray (because I 
started using it for all new code when it looked like it would take 
over). I hope to switch to numpy for everything once the dust 
settles, but I don't want to force my users to all move at once (a 
lot of them are on unix and will have to manually install numpy -- no 
big deal, but I get complaints every time I require a new package).

>  > but it did inspire me to try a few things:
>
>>backend  : TkAgg
>>numerix  : numarray
>>interactive  : True
>>and the crash still happens:
>>from pylab import *
>>plot([1,2,3,4])
>
>>I also tried setting numerix to Numeric and it still happens.
>
>Does it happen with wxAgg? or just plain ol Agg? also try the 
>non-agg TK back-end.

I don't have wx or gtk installed, so no easy way to test those backends.

It does not crash with plain old Agg (but of course I don't see any plot).

I'll be happy to try the "non-agg TK back-end" if you can tell me 
what setting to use for it. I didn't see it in the matplotlibrc's 
list of options (but WXAgg is also missing from that particular 
list), nor on the "Which backend should I use?" page.

>If not, then you've apparently found a tkAgg bug.
>
>TK has always been a bit of a second-class citizen on the Mac -- why 
>haven't you switched to wx yet? ;-)

I started this project several years ago and at the time Tcl/Tk was 
the only game in town for Mac+unix+windows cross-platform support. 
Admittedly the Mac support was poor, but it has gotten much better, 
and I like Tkinter pretty well overall. It would be a major job to 
switch now and I doubt I can justify the expense and time. Sometimes 
I wish I'd used Java, even though the I strongly prefer Python, just 
to get a standard GUI.

I'll try bulding matplotlib from source, just to see if there might 
be some quirk about the installer package.

-- Russell

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] How to build a universal matplotlib for MacOS X

2006-09-22 Thread Russell E. Owen
Here are instructions for building a universal matplotlib for MacOS X 
from source. The topic comes up once in awhile and having just fought 
through it, I figured it was best to post instructions. Thanks to 
Charlie Moad and mpsuzuki for their valuable assistance.

1) Install the prerequisites:

1.1) libz is included with MacOS X 10.4. If you ever installed a copy 
yourself, get rid of it or make sure it's universal.

1.2) Install libpng. Get source, unpack and:

- Configure it for a universal build. On a PPC system (this should be 
two lines; you may have to manually unwrap the first line):
$ CFLAGS="-O -g -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 
-arch ppc" \
   ./configure --disable-dependency-tracking

- On an Intel system use this simpler version:
$ CFLAGS="-arch i386 -arch ppc" \
   ./configure --disable-dependency-tracking

- Build and install as usual:
$ make
$ sudo make install

- If you plan to redistribute matplotlib, delete the dynamic library so 
matplotlib statically links to libpng:
$ sudo rm /usr/local/lib/libpng*.dylib

1.3) Install freetype. Do *NOT* use version 2.2.1; it is broken on MacOS 
X (but fixed in CVS). 2.1.10 works fine. Get source, unpack, and install 
exactly as for libpng except:

- Before building, you may wish to modify 
include/freetype/configure/ftoption.h to enable hinting:
  uncomment #define TT_CONFIG_OPTION_BYTECODE_INTERPRETER
  perhaps comment out #define TT_CONFIG_OPTION_UNPATENTED_HINTING

- After building, you *MUST* delete the dynamic library. At least for 
version 2.1.10 and 2.2.1 it is *NOT* universal, only the static library 
is universal.
$ sudo rm /usr/local/lib/libfreetype*.dylib

2) Make sure you have a universal python installed, e.g. MacPython from 


3) Install matplotlib in the usual fashion:
$ python setup.py build
$ sudo python setup.py install
(I didn't try easy_install, but I suspect it works too)

-- Russell

P.S. The instructions for running configure to get a universal binary 
are from Apple Tech Note 2137: 
 with the 
correction that LDFLAGS must *NOT* be defined (issue number 4387241 in 
Apple Bug Reporter database). Fortunately it is not necessary, and 
suggesting otherwise is a mistake in the tech note.

If you forget --disable-dependency-tracking you'll get error messages 
saying you have an incompatible set of compiler flags.


-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


  1   2   >