Re: [Matplotlib-users] wxbackend scroll_event trouble

2015-10-05 Thread Werner

On 10/4/2015 12:26, Yves Le Feuvre wrote:

Hello,

on my macOSX (didn't check other OS), scroll_event misses every other 
two event when I use mouse wheel

(wx.EVT_MOUSEWHEEL works fine)

What version of wxPython and MPL are you using?

I just tried with and don't see any issues with skipped mouse wheel events:

wxPython classic 3.0.2 classic on Python 2.7 and wxPython Phoenix a 
recent snapshot with both Python 2.7 and Python 3.4, my MPL version is 
1.4.3 with PR  3421 applied 
(https://github.com/matplotlib/matplotlib/pull/3421).


BUT, all this on Windows 8.1, so maybe a OSX issue?

Werner
--
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] stacked bar and a table

2014-01-14 Thread Werner
Hi,

I have to problems when using a table with bar.

On the first one I use this code:

 for row in xrange(rows):
 bars = axes.bar(ind, yearValues[row], width, bottom=yoff, 
color=colours[row])
 yoff = yoff + yearValues[row]

 cellText.append(['%d' % (round(x*1.0, 0)) for x in 
yearValues[row]])

 axes.set_xticks([]) # remove the default ticks

 axes.set_ylabel(labelDesc)

 # Add a table at the bottom of the axes
 the_table = axes.table(cellText=cellText,
   rowLabels=rowLabels, rowColours=colours,
   colLabels=colLabels,
   loc='bottom')
 the_table.set_fontsize(10)

My problem is that the bars are taking up to much space and only a 
portion of my table is shown.

My second problem uses this code:
 for row in xrange(rows):
 # purchase values
 bars = axes.bar(ind, yearValuesP[row], width, bottom=yoffP, 
color=colours[row])
 yoffP = yoffP + yearValuesP[row]

 # consumption values
 bars = axes.bar(ind, yearValuesC[row], width, bottom=yoffC, 
color=colours[row])
 yoffC = yoffC + yearValuesC[row]

 cText = []
 for x in range(len(yearValuesP[row])):
 xP = round(yearValuesP[row][x], 0)
 xC = round(yearValuesC[row][x], 0)
 xN = xP + xC

 cText.append('%d - %d = %d' % (xP, -xC, xN))

 cellText.append(cText)

 # add a line to mark zero
 axes.axhline(linewidth=4, color='k')

 # add a line for net change
 netVal = yoffP + yoffC
 aLine = axes.plot(indNet, netVal, 'o-', color='blue', linewidth=4)
 autolabelLine(aLine, axes)

 axes.set_xticks([]) # remove the default ticks

 axes.set_ylabel(labelDesc)

 # Add a table at the bottom of the axes
 the_table = axes.table(cellText=cellText,
   rowLabels=rowLabels, rowColours=colours,
   colLabels=colLabels,
   loc='bottom')
 the_table.set_fontsize(10)

Here the full table is shown but the text is too small to read.

In both cases I tried 'axes.autoscale(tight=True)' and played with the 
font size but with no success.

Would appreciate any tips on what I may do wrong or what else I need to 
do to have things show correctly.

Werner

P.S.
This is with MPL 1.3.1, with numpy 1.6.1 on Py2.7 32bit on Win7

--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] What backends are working with python 3

2014-06-05 Thread Werner
Hi Jorge,

Oops, sorry for first sending it directly to your mail.

Some time ago I did a bit of work on the wx backend to work with 
wxPython Phoenix.

https://github.com/matplotlib/matplotlib/pull/2803

I haven't had time to look at the last few comments made on that PR.

Just the other day someone contacted me off list and he used it on a 
project of his with a recent build of Phoenix.  He noted small refresh 
issues which corrected itself by resizing the frame, this probably needs 
a "self.Refresh" or similar when things get drawn.

Builds for Phoenix are here:
http://wxpython.org/Phoenix/snapshot-builds/

Recent versions of Phoenix (this is still in development) run on Py 2.7, 
Py 3.3 and Py 3.4 and use the wheel format and can be installed with the 
following at least on Windows and Mac as far as I know:

pip install -U --pre -f http://wxpython.org/Phoenix/snapshot-builds/ 
wxPython_Phoenix

Werner

--
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their 
applications. Written by three acclaimed leaders in the field, 
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Qt4Agg backend possible bug

2014-06-05 Thread Werner
On 6/5/2014 15:10, Jorge Scandaliaris wrote:
> Jorge Scandaliaris  writes:
>
>> Hi,
>> I just mentioned this problem with Qt4Agg and python 3.4 in another thread
>> [1], but I decided to post it on a thread of its own, as I suspect it might
>> be a bug in the Qt4Agg backend.
>>
>> I get a NameError exception (see backtrace below) when trying to use key
>> events in matplotlib (master branch rev:
>> e322d5f5bb024bbec44d3ba76da1bc16bf52af9c), python 3.4.1, and pyqt 4.10.
>> Is this a bug?
> I can confirm that using chr() instead of unichr() fixes this problem. I
> don't know how ones handle python2 vs python3 in these cases
>
> diff --git a/lib/matplotlib/backends/backend_qt4.py
> b/lib/matplotlib/backends/backend_qt4.py
> index 70152aa..b0d8233 100644
> --- a/lib/matplotlib/backends/backend_qt4.py
> +++ b/lib/matplotlib/backends/backend_qt4.py
> @@ -362,7 +362,7 @@ class FigureCanvasQT(QtGui.QWidget, FigureCanvasBase):
>   if event_key > MAX_UNICODE:
>   return None
>   
> -key = unichr(event_key)
> +key = chr(event_key)
>   # qt delivers capitalized letters.  fix capitalization
>   # note that capslock is ignored
>   if 'shift' in mods:
You would use 'six' - https://pypi.python.org/pypi/six it is used by 
many packages including wxPython.

import six

if six.PY3:
key = chr(event_key)

else:
key = unichr(event_key)


Werner

--
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their 
applications. Written by three acclaimed leaders in the field, 
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Qt4Agg backend possible bug

2014-06-05 Thread Werner
On 6/5/2014 15:45, "V. Armando Solé" wrote:
...
>> You would use 'six' - https://pypi.python.org/pypi/six it is used by
>> many packages including wxPython.
>>
>> import six
>>
>> if six.PY3:
>>  key = chr(event_key)
>>
>> else:
>>  key = unichr(event_key)
>>
> Just for info.
>
> I had never heard about six. Is there anything wrong using sys???:
>
> import sys
> if sys.version <  "3.0":
>   key = unichr(event_key)
> else:
>   key = chr(event_key)
>
> Thanks,
Using 'six' for just the above case is definitely overkill, but it has 
many more goodies in it to make py2/py3 single source code easier.

Werner

--
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their 
applications. Written by three acclaimed leaders in the field, 
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] 1.4 install on Windows 8.1 with pip gives bad hash

2014-08-27 Thread Werner
Just FYI,

I tried to install with pip but got the following error.

C:\Python34\Scripts>pip install -U matplotlib
Downloading/unpacking matplotlib
   Hash of the package 
https://pypi.python.org/packages/source/m/matplotlib/matplotlib-1.4.0.tar.gz#md5=1daf7f2123d94745f
eac1a30b210940c (from https://pypi.python.org/simple/matplotlib/) 
(b3547692387bce383d7a001a8e03ce87) doesn't match the e
xpected hash 1daf7f2123d94745feac1a30b210940c!
Cleaning up...

Werner

P.S.
I installed using the .exe installer without problems.

--
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] python3 and basemap bluemarble()

2014-10-17 Thread Werner
On 10/17/2014 13:27, Tommy Carstensen wrote:
> To matplotlib-users,
>
> basemap bluemarble() requires PIL, which is not available for Python3.
Have you tried using pillow? https://pypi.python.org/pypi/Pillow/2.6.1

It might just a drop in replacement, but that depends on how bluemarble 
uses PIL.

http://pillow.readthedocs.org/porting-pil-to-pillow.html

Werner

--
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Missing Module: six ?

2015-02-13 Thread Werner

Hi Ralph,

On 2/13/2015 12:40, ralph hosmer wrote:
Per your instructions, I downloaded [] and installed using the 
'wizard'.  The file I'm trying to execute is currently in a PyCharm 
project, and the Error Trace I get is as follows:


C:\Python34\python.exe 
"C:/Users/Ralph/PycharmProjects/anuASTRO4x/src/Euler's Method.py"

Traceback (most recent call last):
  File "C:/Users/Ralph/PycharmProjects/anuASTRO4x/src/Euler's 
Method.py", line 21, in 
import pylab # This program requires the matplotlib python library 
for the plots.

  File "C:\Python34\lib\site-packages\pylab.py", line 1, in 
from matplotlib.pylab import *
  File "C:\Python34\lib\site-packages\matplotlib\__init__.py", line 
105, in 

import six
ImportError: No module named 'six'
Euler's Method


'from matplotlib.pylab import *' calls '__init__-py' and tries 
[unsuccessfully] to 'import 'six'.


What do you suggest I do to correct the ImportError: No module named 
'six' ?

Hhm, that is one of the requirements, see under the Windows section:
http://matplotlib.org/users/installing.html?highlight=requirements

You should be able to install them with 'pip' - e.g. 'pip install six'

numpy is a bit more of a hazzle, in the past Christoph Gohlke's site had 
.exe's but there are now wheels, so you need to download the correct one 
(win32 and py3.4) and then use pip to install it.


https://pip.pypa.io/en/latest/user_guide.html#installing-from-wheels
http://www.lfd.uci.edu/~gohlke/pythonlibs/

Werner
--
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] cumulative distribution function

2007-03-20 Thread Werner Hoch
Hi Simson,

On Wednesday 21 March 2007 02:59, Simson Garfinkel wrote:
> Thanks for the information. Unfortunately, this CDF doesn't look like
> the CDF that we see in other published papers. I'm not sure what they
> are done with...  But they have a thin line that shows the integral
> of all measurements, rather than a bar graph. The problem with a bar
> graph is that different bin widths give different results.
>
> GNU Plot seems to do a decent job, as can e seen at http://
> chem.skku.ac.kr/~wkpark/tutor/gnuplot/gpdocs/prob.htm. But there
> should be a way to do this nicely with matplotlib, right?

Try this one:

x = sin(arange(0,100,0.1)) ## your function

## plot the sorted value of your function against
## a linear vektor from 0 to 1 with the same length

plot(sort(x), arange(len(x))/float(len(x)))

Regrads
Werner

-
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
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] matplotlib-0.90.1 no longer builds _wxagg.so

2007-06-03 Thread Werner Hoch
Hi all,

I've build matplotlib but there is no matplotlib/backends/_wxagg.so.

Even without that file matplotlib works fine with the WX backend and 
pycrust.

What is that file good for?
Is it required to run matplotlib properly (maybe in other use cases)?

I'm working on openSUSE 10.2 on x86_64.

Regards
Werner 

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


[Matplotlib-users] examples for 0.99

2009-08-16 Thread Werner F. Bruhin
I am just starting to test 0.99 (having remained on 0.90.1 for some time 
now).

I can't find the examples - can anyone point out were they are.

Used the following to install:
matplotlib-0.99.0.win32-py2.5-setup.exe

Werner



--
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
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] wx and matplotlib

2009-08-16 Thread Werner F. Bruhin
I am trying to put together a wxPython frame using py.aui to show 
multiple matplotlib.figures/canvas.

Would like that each figure takes x percentage of available screen 
estate.  I.e. would like e.g. to have 2 rows with 3 columns of 
figures/statistics, i.e. 6 graphics.

If the total screen estate is too small then there should be scrollbars 
per figure/canvas.

Hopefully some samples code (in the example files which existed in 
0.90.x) can put me in the right direction, otherwise I will try to put 
together a stand alone sample (without access to my database) to show my 
problem.


Werner





--
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
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] wx and matplotlib

2009-08-17 Thread Werner F. Bruhin
Hi Chris,

Christopher Barker wrote:
> Werner F. Bruhin wrote:
>   
>> I am trying to put together a wxPython frame using py.aui to show 
>> multiple matplotlib.figures/canvas.
>> 
>
> I'd recommend you take a look at wxMPL -- it's a nice way to embed MPL 
> in wx.
>   
I'll have a look at this.
>   
>> Would like that each figure takes x percentage of available screen 
>> estate.  I.e. would like e.g. to have 2 rows with 3 columns of 
>> figures/statistics, i.e. 6 graphics.
>> 
>
> To be clear with the vocabulary -- in MPL, a "figure" would be one 
> wxWindow. In that you can put multiple "axes" which show the actual 
> plots (sometimes referred to as subplots). In this case, I'm not sure if 
> you want more than one MPL figure.
>   
I am not sure yet if multiple axes/subplots is the way to go or to have
multiple figures.  I was leaning towards multiple figures, each a pane
in AUI, to allow the user to size them how they want.
>   
>> If the total screen estate is too small then there should be scrollbars 
>> per figure/canvas.
>> 
>
> If you want multiple figures, than this isn't really an MPL question. 
> You'd do that layout the same way you would with any other set of 
> wxWindows -- probably putting them all on a wxScrolledWindow, in Sizers, 
> and giving them a minimum size.
>
> With a single MPL Figure, it would be similar, put it on 
> wxScrolledWindows, with a minimum size set.
>   
O.K. will play with this.  In the mean time I found also some sample
code from the matplotlib doc/gallery (great piece of documentation!).
>   
>> Hopefully some samples code (in the example files which existed in 
>> 0.90.x)
>> 
> Is this what you are looking for?
>
> http://matplotlib.sourceforge.net/examples/index.html
>
> in particular, you might want to look at the wx examples here:
>
> http://matplotlib.sourceforge.net/examples/user_interfaces/index.html
>   
Yes, this is what I was looking for.  Although it is a pity that these
do not have the sample graph as is shown in the gallery - but looking at
both I think I should find what I need.

Thanks for the tips
Werner


--
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
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] xticklabels possition on a bar chart

2009-08-18 Thread Werner F. Bruhin




My lables for the different bars are not centered below the bar but are
all to the left side of the bars (lower left corner).



This is what I am basically doing:

    axes = panel.figure.add_subplot(2, 2, 3)
...
    axes.bar(indx, values, color=colors)
    axes.set_xticklabels(labels)

I can not find how to provide the lables to the "bar" call or how else
to make sure that "Rot" is centered under the first bar, "Weiß" under
the second bar and so on.

Ideally I would like to have these labels printed at an angle.

Appreciate any hints
Werner

P.S.
mpl version: '0.99.0'
Python 2.5.2 on Vista


--
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
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] xticklabels possition on a bar chart

2009-08-18 Thread Werner F. Bruhin
Werner F. Bruhin wrote:
...
> Ideally I would like to have these labels printed at an angle.
Put my glasses on and found the rotation property in the documentation, 
only issue left is centering the labels below the bars.

Werner



--
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
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] xticklabels possition on a bar chart

2009-08-19 Thread Werner F. Bruhin
Eric,

Eric Firing wrote:
> Werner F. Bruhin wrote:
>> Werner F. Bruhin wrote:
>> ...
>>> Ideally I would like to have these labels printed at an angle.
>> Put my glasses on and found the rotation property in the 
>> documentation, only issue left is centering the labels below the bars.
>
> Are you using the align='center' kwarg to bar()?
No I did not, tried it but no change.

Werner




--
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
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] xticklabels possition on a bar chart

2009-08-19 Thread Werner F. Bruhin
Jae-Joon Lee wrote:
> You need to adjust the positions of the ticks.
> bar command (by default) creates boxes so that their left side
> corresponds the first argument.
>
> http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.bar
>
> so, in your case, something like below will work (0.4 from 0.8/2 where
> 0.8 is the default width of the bar).
>
> axes.set_xticks([x+0.4 for x in indx])
>   
That does the trick.  Thanks.

Although I wonder why "align='center'" does not work for me.

Will review the other samples and read the doc some more.

Werner




--
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
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Percentage in pie in e.g. white instead of black

2009-08-21 Thread Werner F. Bruhin
I would like to have the percentage values shown in white instead of in 
black within a pie chart.

I figured I could do something like:

def reColor(percent):
"I am lost here on how to format the percentage and change 
the color"

axes.pie(values, labels=labels, autopct=reColor, shadow=False, 
colors=colors)

I thought I could use a mpl.text.Text but I only get the percentage in 
"reColor".

Looked at the gallery and tried to based it on the "barchart_demo2.py" 
example without success.  Although would prefer not to have to loop 
through the text.Text instances and figure out which ones are a 
percentage and then color them - but I guess that would be one way of 
doing it but it looks a bit odd to me.

Thanks for any tips
Werner




--
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
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Percentage in pie in e.g. white instead of black

2009-08-22 Thread Werner F. Bruhin
Werner F. Bruhin wrote:
> I would like to have the percentage values shown in white instead of in 
> black within a pie chart.
>   
The following code is doing what I want, but it does not feel right.

 myPie = axes.pie(values, labels=labels, autopct=u'%1.0f%%', 
shadow=False, colors=colors)
 
for x in myPie[2]:
 x.set_color('w')

Is there really no "cleaner" way of doing this?

Werner



--
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
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] canvas.Refresh problem with 0.99

2009-08-23 Thread Werner F. Bruhin
I previously used version '0.90.1' and could do something along these lines.

figure.add_axes
...  etc
canvas.Refresh()

User makes a new selection and in the code I do:

figure.clear()
figure.add_axes
... etc
canvas.Refresh()

With 0.99 and wxAgg on Windows Vista with wxPython 2.8.10.1 Unicode and 
Python 2.5.4 this does not work.

The "old" figure remains and the new one is only shown when I resize the 
frame which contains a wx.Splitter with the right window containing the 
mpl.figure on a panel.

If I add canvas.draw() then most is shown, except some mpl.text elements 
(e.g. figure.title) - which again are shown if I resize.

Appreciate any hint on how to solve this.

Werner





--
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
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] canvas.Refresh problem with 0.99 - solved

2009-08-23 Thread Werner F. Bruhin
Werner F. Bruhin wrote:
> I previously used version '0.90.1' and could do something along these lines.
>
> figure.add_axes
> ...  etc
> canvas.Refresh()
>
> User makes a new selection and in the code I do:
>
> figure.clear()
> figure.add_axes
> ... etc
> canvas.Refresh()
>
> With 0.99 and wxAgg on Windows Vista with wxPython 2.8.10.1 Unicode and 
> Python 2.5.4 this does not work.
>
> The "old" figure remains and the new one is only shown when I resize the 
> frame which contains a wx.Splitter with the right window containing the 
> mpl.figure on a panel.
>
> If I add canvas.draw() then most is shown, except some mpl.text elements 
> (e.g. figure.title) - which again are shown if I resize.
>
> Appreciate any hint on how to solve this.
>   
I had to add the canvas.Draw() call, but I had that to early in my code, 
i.e. the title was only added to the figure after I had called Draw() - 
0.90 was forgiven me this stupid mistake.

Sorry for the noise.
Werner



--
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
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Pareto diagram - align cumulative percentage marker in the middle of the bars

2009-08-25 Thread Werner F. Bruhin




I trying to create a Pareto diagram and would like that the percentage
marker is center aligned on the bars, i.e. the blue point should be
center aligned on the bar instead of to be aligned on the left edge in
the following image. 



The other problem I have is that the xtick_labels are cut off at the
bottom when the frame is resized below a certain size.  How can I
prevent this?

Thanks for any tips on these problems.
Werner


--
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
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Pareto diagram - align cumulative percentage marker in the middle of the bars

2009-08-25 Thread Werner F. Bruhin
Jouni K. Seppänen wrote:
> "Werner F. Bruhin"  writes:
>
>   
>> I trying to create a Pareto diagram and would like that the percentage
>> marker is center aligned on the bars,
>> 
>
> Perhaps the easiest solution is to use bar(...,align='center').
>   
Thanks, that does the trick for me, after getting rid of some hack for 
the bar labels.

Werner





--
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
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Pareto diagram - align cumulative percentage marker in the middle of the bars

2009-08-26 Thread Werner F. Bruhin
Chris,

Christopher Barker wrote:
> Werner F. Bruhin wrote:
>> The other problem I have is that the xtick_labels are cut off at the 
>> bottom when the frame is resized below a certain size.  How can I 
>> prevent this?
>
> I don't think MPL yet has a system for making things fit, so you need 
> to change the size/position of your axes object:
>
> axes.set_position(pos, which='both')
>
> """
> Set the axes position with:
>
> pos = [left, bottom, width, height]
> """
>
> these are in "figure units" which are relative to figure size, from 0 
> to 1. Unfortunately, what this means is that the amount of space for 
> the axis labels varies with the size of the figure, as you've discovered.
>
>
> The default for a single axes in a figure is:
>
> (0.125,  0.1,  0.9,  0.9)
>
> so you might try something like:
>
> axes.set_position((0.125,  0.15,  0.9,  0.85) )
>
> what is best depends on what size you want your figure to look good at.
Thanks for this tip, will play around with this a bit.  First try shifts 
the figure of the panel on the top left and right, so this will need a 
bit more digging on my part.

Werner



--
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
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] mpl 0.99 and py2exe

2009-09-09 Thread Werner F. Bruhin
I have run into a bit of problem using 0.99 and py2exe.

I am getting errors "TypeError: unsupported operand type(s) for +=: 
'NoneType' and 'str'" in mlab.pyo after py2exe'd my application.

This is caused by this type of code, as one normally uses the optimize 
option with py2exe which means that the docs are stripped from the .pyo 
files.
"psd.__doc__ = psd.__doc__ % kwdocd"

I changed it to:
if psd.__doc__ is not None:
psd.__doc__ = psd.__doc__ % kwdocd
else:
psd.__doc__ = ""

Above is a bit of a hack, if someone can suggest how to correct this in 
a way which would get accepted as a patch I would search all modules 
correct them.

Werner



--
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
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] mpl 0.99 and py2exe

2009-09-09 Thread Werner F. Bruhin
Werner F. Bruhin wrote:
> I have run into a bit of problem using 0.99 and py2exe.
>
> I am getting errors "TypeError: unsupported operand type(s) for +=: 
> 'NoneType' and 'str'" in mlab.pyo after py2exe'd my application.
>
> This is caused by this type of code, as one normally uses the optimize 
> option with py2exe which means that the docs are stripped from the .pyo 
> files.
> "psd.__doc__ = psd.__doc__ % kwdocd"
>
> I changed it to:
> if psd.__doc__ is not None:
> psd.__doc__ = psd.__doc__ % kwdocd
> else:
> psd.__doc__ = ""
>
> Above is a bit of a hack, if someone can suggest how to correct this in 
> a way which would get accepted as a patch I would search all modules 
> correct them.
>   
Maybe a nicer solution would be:
if __debug__:
psd.__doc__ = psd.__doc__ % kwdocd

Also that would mean that above is not run when running Python as 
"python -O script.py or python -OO script.py where the first solution 
means that with -O the it would still be executed.

Werner



--
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
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] mpl 0.99 and py2exe

2009-09-10 Thread Werner F. Bruhin
Jouni K. Seppänen wrote:
> "Werner F. Bruhin"  writes:
>
>   
>>> I think this has been fixed on the trunk for good, by changing all
>>> docstring modifications to use decorators (defined in docstring.py) that
>>> check for nonexistent docstrings. The changes are perhaps too big to
>>> apply on the 0.99 branch.
>>>   
>>>   
>> As it is fixed in trunk is there a need/much use for a patch to 0.99?
>> I.e. how far of is the next release which includes what ever is in
>> trunk?
>> 
>
> I think John Hunter said somewhere that he plans to release 1.0 in a few
> months, but software release schedules are notoriously difficult to
> estimate, and with volunteer-driven open-source software even more so. I
> think the answer depends on how many people use py2exe, about which I
> have absolutely no idea.
>   
I don't think it is worse a patch as the work around is very easy.  I
documented what is needed for a py2exe setup.py with mpl 0.99 on the
py2exe site at the end of the following page
http://www.py2exe.org/index.cgi/MatPlotLib .

While doing this I noted one more problem if one uses backend_wx, the
wxPython version check will always fail if py2exe'd.  I added "if not
hasattr(sys, 'frozen'):" on line 113 and indented lines 114 to 131.
Hopefully someone could make this change for the next version of mpl.

Werner







--
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
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplotlib 0.99.1rc1 available for testing

2009-09-14 Thread Werner F. Bruhin
John Hunter wrote:
> We are preparing a bugfix release of the 0.99 branch, and a release
> candidate 0.99.1rc1 is available for testing.
>
>   http://drop.io/xortel1#
>   
Just installed it on Vista and saw the following issues so far.

- Installer is not running elevated - tracker item 2858636 added
- the issue with __doc__ handling in e.g. mlab.py is still present, see 
tracker item 2593149 and http://www.py2exe.org/index.cgi/MatPlotLib at 
the end of that page a work around is suggested
- backend_wx does a wxPython version check which does not work when the 
application is py2exe'd - tracker item 2858638 added and the above wiki 
page also contains a work around/correction suggestion.

Werner



--
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
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplotlib 0.99.1rc1 available for testing

2009-09-15 Thread Werner F. Bruhin
John,

John Hunter wrote:
> On Mon, Sep 14, 2009 at 10:13 AM, Werner F. Bruhin
>  wrote:
>
>   
>> Just installed it on Vista and saw the following issues so far.
>> 
>
> Hey Werner, thanks for the reports.
>   
You are welcome - anyhow I think it would be more appropriate for me to 
thank you and everyone else involved in the mpl developement.  Thanks 
really a great job and it keeps getting even better!

...
>> - the issue with __doc__ handling in e.g. mlab.py is still present, see
>> tracker item 2593149 and http://www.py2exe.org/index.cgi/MatPlotLib at the
>> end of that page a work around is suggested
>> 
>
> This is not expected to be fixed until matplotlib 1.0.  The changes
> required to fix this are too pervasive for the 0.99 release branch,
> where the emphasis is on stability.
>
>   
>> - backend_wx does a wxPython version check which does not work when the
>> application is py2exe'd - tracker item 2858638 added and the above wiki page
>> also contains a work around/correction suggestion.
>> 
>
> OK, we will take a look at this too.
>   
Maybe instead of using "import wxversion" (I think its intent is for 
developers having multiple versions installed) you might wnat to change 
the code in backend_wx.py to use one of the following:
import wx
 >>> wx.__version__
'2.8.10.1'
 >>> wx.version

 >>> wx.version()
'2.8.10.1 (msw-unicode)'
 >>> wx.VERSION
(2, 8, 10, 1, '')
 >>> wx.VERSION_STRING
'2.8.10.1'

This way you don't use wxversion and the check will run in all situations.

Best regards
Werner




--
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplotlib 0.99.1rc1 available for testing

2009-09-15 Thread Werner F. Bruhin
Hi Eric,

Eric Firing wrote:
>
>>>> - backend_wx does a wxPython version check which does not work when 
>>>> the
>>>> application is py2exe'd - tracker item 2858638 added and the above 
>>>> wiki page
>>>> also contains a work around/correction suggestion.
>>>> 
>>> OK, we will take a look at this too.
>>>   
>> Maybe instead of using "import wxversion" (I think its intent is for 
>> developers having multiple versions installed) you might wnat to 
>> change the code in backend_wx.py to use one of the following:
>> import wx
>>  >>> wx.__version__
>> '2.8.10.1'
>>  >>> wx.version
>> 
>>  >>> wx.version()
>> '2.8.10.1 (msw-unicode)'
>>  >>> wx.VERSION
>> (2, 8, 10, 1, '')
>>  >>> wx.VERSION_STRING
>> '2.8.10.1'
>>
>> This way you don't use wxversion and the check will run in all 
>> situations.
>
> I don't understand.  You are correct that wxversion is used so that if 
> multiple versions are installed, one that will work is the one that 
> gets imported.  This seems to be important functionality; it was added 
> because people were having problems, and it seems to have solved those 
> problems.  It sounds like you are advocating going back to a simple 
> version check.
Unless I misread the code it just wants to ensure that at least version
2.8 is used, this could be done using any of the above variables.  Only
things wxversion is doing in addition is to propose to download and for
a developer if he is having a default of < 2.8 it will load 2.8 or
higher if available.
>
> Instead, it looks to me like the best solution is the one you provided 
> at the very bottom of http://www.py2exe.org/index.cgi/MatPlotLib.
I am happy with what ever change is done as long as it also works for
py2exe'd application.

Werner


>
> Eric
>
>





--
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplotlib 0.99.1rc1 available for testing

2009-09-17 Thread Werner F. Bruhin
Eric,

Eric Firing wrote:
> Werner,
>
>>> Instead, it looks to me like the best solution is the one you 
>>> provided at the very bottom of 
>>> http://www.py2exe.org/index.cgi/MatPlotLib.
>> I am happy with what ever change is done as long as it also works for
>> py2exe'd application.
>>
>
> I have applied this fix to the branch and the trunk, so wxversion will 
> not be imported by py2exe'ed programs.
Great.

I will check it out on the next rc or release.

Werner



--
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] does mpl.canvas has a flag "needsdrawing"?

2009-09-18 Thread Werner F. Bruhin
I have multiple canvas and sometimes one or more might have nothing to 
draw (no data).

Currently I just call.

canvas.draw()
canvas.Refresh()

for each of the canvas, but this gives me an error if there is no data.

Is there a built-in flag I can check before calling draw?  Or do I have 
to keep create my own?

Werner

PS
If it is of any help, I get this (also I have mpl.verbose.level = u'silent':

C:\Python25\lib\site-packages\matplotlib\axes.py:3996: UserWarning: No 
labeled objects found. Use label='...' kwarg on individual plots.
  warnings.warn("No labeled objects found. "

And here is the traceback.
Traceback (most recent call last):
  File "C:\Dev\twcbBranchv31\Program\panelstats.py", line 178, in DoRefresh
self.RefreshAllGraphs()
  File "C:\Dev\twcbBranchv31\Program\panelstats.py", line 313, in 
RefreshAllGraphs
self.priceChangeP.canvas.draw()
  File 
"C:\Python25\Lib\site-packages\matplotlib\backends\backend_wxagg.py", 
line 59, in draw
FigureCanvasAgg.draw(self)
  File 
"C:\Python25\Lib\site-packages\matplotlib\backends\backend_agg.py", line 
314, in draw
self.figure.draw(self.renderer)
  File "C:\Python25\Lib\site-packages\matplotlib\artist.py", line 46, in 
draw_wrapper
draw(artist, renderer, *kl)
  File "C:\Python25\Lib\site-packages\matplotlib\figure.py", line 774, 
in draw
for a in self.axes: a.draw(renderer)
  File "C:\Python25\Lib\site-packages\matplotlib\artist.py", line 46, in 
draw_wrapper
draw(artist, renderer, *kl)
  File "C:\Python25\Lib\site-packages\matplotlib\axes.py", line 1721, in 
draw
a.draw(renderer)
  File "C:\Python25\Lib\site-packages\matplotlib\artist.py", line 46, in 
draw_wrapper
draw(artist, renderer, *kl)
  File "C:\Python25\Lib\site-packages\matplotlib\axis.py", line 736, in draw
for tick, loc, label in self.iter_ticks():
  File "C:\Python25\Lib\site-packages\matplotlib\axis.py", line 677, in 
iter_ticks
majorLocs = self.major.locator()
  File "C:\Python25\Lib\site-packages\matplotlib\dates.py", line 754, in 
__call__
dmin, dmax = self.viewlim_to_dt()
  File "C:\Python25\Lib\site-packages\matplotlib\dates.py", line 454, in 
viewlim_to_dt
return num2date(vmin, self.tz), num2date(vmax, self.tz)
  File "C:\Python25\Lib\site-packages\matplotlib\dates.py", line 249, in 
num2date
if not cbook.iterable(x): return _from_ordinalf(x, tz)
  File "C:\Python25\Lib\site-packages\matplotlib\dates.py", line 170, in 
_from_ordinalf
dt = datetime.datetime.fromordinal(ix)
ValueError: ordinal must be >= 1



--
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] does mpl.canvas has a flag "needsdrawing"?

2009-09-18 Thread Werner F. Bruhin
John,

John Hunter wrote:
> On Fri, Sep 18, 2009 at 4:39 AM, Werner F. Bruhin  
> wrote:
>   
>> I have multiple canvas and sometimes one or more might have nothing to
>> draw (no data).
>>
>> Currently I just call.
>>
>> canvas.draw()
>> canvas.Refresh()
>>
>> for each of the canvas, but this gives me an error if there is no data.
>>
>> Is there a built-in flag I can check before calling draw?  Or do I have
>> to keep create my own?
>> 
>
> There is no such flag, but you should not get an error on drawing an
> empty figure or one that doesn't "need" to be drawn.  Can you post
> example code that produces the error?
>   
I narrowed it down to one line of code, if I comment the following line
then the error goes away.

axes.xaxis.set_major_formatter(yearFmt)

Is this enough for you?  Or do you like some runnable code?

Werner




--
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] does mpl.canvas has a flag "needsdrawing"?

2009-09-18 Thread Werner F. Bruhin

John Hunter wrote:
We want a complete, free standing example that exposes the bug, with 
any additional info like mpl backend and version number.

matplotlib: 0.99.0
wx.Python: 2.8.10.1 (unicode on Win Vista)
Python 2.5.4

If I comment line 78 then the exception goes away.  The attached code 
does not use, but the exception is the same as I get in my code when I 
call draw.


Hope this helps
Werner




On Sep 18, 2009, at 7:43 AM, "Werner F. Bruhin" 
 wrote:



John,

John Hunter wrote:
On Fri, Sep 18, 2009 at 4:39 AM, Werner F. Bruhin 
 wrote:



I have multiple canvas and sometimes one or more might have nothing to
draw (no data).

Currently I just call.

canvas.draw()
canvas.Refresh()

for each of the canvas, but this gives me an error if there is no 
data.


Is there a built-in flag I can check before calling draw?  Or do I 
have

to keep create my own?



There is no such flag, but you should not get an error on drawing an
empty figure or one that doesn't "need" to be drawn.  Can you post
example code that produces the error?


I narrowed it down to one line of code, if I comment the following line
then the error goes away.

   axes.xaxis.set_major_formatter(yearFmt)

Is this enough for you?  Or do you like some runnable code?

Werner




-- 


Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and 
stay
ahead of the curve. Join us from November 9-12, 2009. Register 
now!

http://p.sf.net/sfu/devconf
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users





# -*- coding: utf-8 -*-#
#!/usr/bin/env python
"""
An example of how to use wx or wxagg in an application with the new
toolbar - comment out the setA_toolbar line for no toolbar
"""

import datetime

from numpy import arange, sin, pi

import matplotlib
print matplotlib.__version__

# uncomment the following to use wx rather than wxagg
#matplotlib.use('WX')
#from matplotlib.backends.backend_wx import FigureCanvasWx as FigureCanvas

# comment out the following to use wx rather than wxagg
matplotlib.use('WXAgg')
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas

from matplotlib.backends.backend_wx import NavigationToolbar2Wx

from matplotlib.figure import Figure

from matplotlib.dates import YearLocator, MonthLocator, DateFormatter, WeekdayLocator

from matplotlib.dates import MONDAY, SATURDAY

from matplotlib.finance import quotes_historical_yahoo


import wx

print wx.__version__

class CanvasFrame(wx.Frame):

def __init__(self):
wx.Frame.__init__(self,None,-1,
 'CanvasFrame',size=(550,350))

self.SetBackgroundColour(wx.NamedColor("WHITE"))

self.figure = Figure()
self.canvas = FigureCanvas( self, -1, self.figure)

date1 = datetime.date( 2002, 1, 5 )
date2 = datetime.date( 2003, 12, 1 )

# every monday
mondays   = WeekdayLocator(MONDAY)

# every 3rd month
months= MonthLocator(range(1,13), bymonthday=1, interval=3)
monthsFmt = DateFormatter("%b '%y")


quotes = quotes_historical_yahoo('INTC', date1, date2)
if not quotes:
print 'Found no quotes'
raise SystemExit

dates = [q[0] for q in quotes]
opens = [q[1] for q in quotes]

self.axes = self.figure.add_subplot(111)
# following line is commented to force the exception
##self.axes.plot_date(dates, opens, '-')

self.axes.autoscale_view()
self.axes.grid(True)

yearLoc = YearLocator()
yearFmt = DateFormatter('%Y')
# comment the following line not to get the exeception
self.axes.xaxis.set_major_formatter(yearFmt)

self.sizer = wx.BoxSizer(wx.VERTICAL)
self.sizer.Add(self.canvas, 1, wx.LEFT | wx.TOP | wx.GROW)
self.SetSizer(self.sizer)
self.Fit()

self.add_toolbar()  # comment this out for no toolbar


def add_toolbar(self):
self.toolbar = NavigationToolbar2Wx(self.canvas)
self.toolbar.Realize()
if wx.Platform == '__WXMAC__':
# Mac platform (OSX 10.3, MacPython) does not seem to cope with
# having a toolbar in a sizer. This work-around gets the buttons
# back, but at the expense of having the toolbar at the top
self.SetToolBar(self.toolbar)
else:
# On Windows platform, default window size is incorrect, so set
# toolbar width to

Re: [Matplotlib-users] does mpl.canvas has a flag "needsdrawing"?

2009-09-18 Thread Werner F. Bruhin
John Hunter wrote:
> On Fri, Sep 18, 2009 at 8:15 AM, Werner F. Bruhin  
> wrote:
>   
>> John Hunter wrote:
>> 
>>> We want a complete, free standing example that exposes the bug, with any
>>> additional info like mpl backend and version number.
>>>   
>
> Thanks -- when posting a bug, please consider taking the time to make
> a *minimal* example.
Sorry about that - was a bit in a hurry, but that is no excuse!

Will do better next time.

Thanks for anyhow having taken the time to look at it and to distill it 
down.

Werner



--
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] does mpl.canvas has a flag "needsdrawing"?

2009-09-18 Thread Werner F. Bruhin
Hi Jae-Joon,

Jae-Joon Lee wrote:
> My guess is that the error happens when the matplotlib tries to format
> the date ticklabels when the xlim is not correctly set, i.e., [0, 1]
> in the example. But, I'm not sure what is the best approach here.
>
> Werner, if there is nothing to draw (i,e, xlim is [0,1]), change the
> xlim to some arbitrary range that is greater than 1 (e.g, [1,2]). For
> example, in your code, you may do something like following after
> calling the autoscale_view().
>   
Thanks for the tip.  I have in the mean time reorganized my code and I
am just bypassing the problematic code if there is nothing to draw.

Werner




--
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Py2.5.4 on Win7

2009-10-23 Thread Werner F. Bruhin
I am just installing Windows 7 Pro and I am running into a problem with 
matplotlib.

When running e.g. barchart_demo.py I get an error that it can not find 
msvcp71.dll (the dll is in C:\Python25) and I see the following exception.

Traceback (most recent call last):
  File "barchart_demo.py", line 3, in 
import matplotlib.pyplot as plt
  File "C:\Python25\Lib\site-packages\matplotlib\pyplot.py", line 6, in 

from matplotlib.figure import Figure, figaspect
  File "C:\Python25\Lib\site-packages\matplotlib\figure.py", line 16, in 

import artist
  File "C:\Python25\Lib\site-packages\matplotlib\artist.py", line 5, in 

from transforms import Bbox, IdentityTransform, TransformedBbox, 
TransformedPath
  File "C:\Python25\Lib\site-packages\matplotlib\transforms.py", line 
34, in 
from matplotlib._path import affine_transform
ImportError: DLL load failed: Le module spcifi est introuvable.

Anyone seen this problem before on Win7?

BTW, I can run e.g. Boa (a wxPython based IDE).  I have no problem 
running my application which is wxPython based as long as I don't call 
anything which uses mpl.

Version info:
Win 7 Pro
# Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit 
(Intel)]
# wxPython 2.8.10.1 (unicode), Boa Constructor 0.6.1

matplotlib.__version__
'0.99.1'

Werner

P.S.
Installed Python for all users - will try installing for me only



--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Py2.5.4 on Win7

2009-10-23 Thread Werner F. Bruhin




Hi Stan,

Stan West wrote:

  
From: Werner F. Bruhin [mailto:werner.bru...@free.fr] 
Sent: Friday, October 23, 2009 07:31

I am just installing Windows 7 Pro and I am running into a 
problem with matplotlib.

When running e.g. barchart_demo.py I get an error that it can 
not find msvcp71.dll (the dll is in C:\Python25) and I see 
the following exception.

Traceback (most recent call last):

  
[...]
  
  
  File 
"C:\Python25\Lib\site-packages\matplotlib\transforms.py", 
line 34, in 
from matplotlib._path import affine_transform
ImportError: DLL load failed: Le module spcifi est introuvable.

  
[...]

Hi, Werner.  I've been running the release candidate of Windows 7 and haven't
encountered that issue.

Same here, I had no problem with the RC, but frankly did very little
work with it.

My Python installation is that of Python(x,y) 2.1.17,
which includes the same version of Python as yours, and I'm using a build of
matplotlib from SVN, although I previously used version 0.99.0 without DLL
trouble.

On my machine, I found msvcp71.dll in several directories under
C:\Python25\Lib\site-packages (including site-packages\wx-2.8-msw-unicode\wx),
in C:\Windows\System32, and in several locations under C:\Program Files, but
not in C:\Python25.  There is a similarly-named msvcr71.dll in C:\Python25.
  

I have both "p" and "r" of msvcX71.dll.

  
I'm wondering whether and how msvcp71.dll is related to the traceback to the
_path module, because the _path module comprises a .pyd (~= .dll) file.  You
might start Python, enter "from matplotlib._path import affine_transform", and
see whether the import is successful.
  

No idea, I see it when I try to run barchart_demo.py (MPL example)
which uses pyplot.

I get this error:


Free translation: can't start program as MSVCP71.dll is missing.

If I run Process Monitor from SysInternals I see the following (partial
info):
19:22:17,5153511    python.exe    4884    CloseFile   
C:\Python25\Lib\site-packages\matplotlib    SUCCESS    
19:22:17,5155160    python.exe    4884    QueryOpen   
C:\Python25\Lib\site-packages\matplotlib\_path.pyd    FAST IO
DISALLOWED    
19:22:17,5156277    python.exe    4884    CreateFile   
C:\Python25\Lib\site-packages\matplotlib\_path.pyd    SUCCESS   
Desired Access: Read Attributes, Disposition: Open, Options: Open
Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete,
AllocationSize: n/a, OpenResult: Opened
19:22:17,5156601    python.exe    4884    QueryBasicInformationFile   
C:\Python25\Lib\site-packages\matplotlib\_path.pyd    SUCCESS   
CreationTime: 21/09/2009 12:48:34, LastAccessTime: 21/09/2009 12:48:34,
LastWriteTime: 21/09/2009 12:48:34, ChangeTime: 23/10/2009 10:50:57,
FileAttributes: A
19:22:17,5156678    python.exe    4884    CloseFile   
C:\Python25\Lib\site-packages\matplotlib\_path.pyd    SUCCESS    
19:22:17,5158058    python.exe    4884    CreateFile   
C:\Python25\Lib\site-packages\matplotlib\_path.pyd    SUCCESS   
Desired Access: Read Data/List Directory, Execute/Traverse,
Synchronize, Disposition: Open, Options: Synchronous IO Non-Alert,
Non-Directory File, Attributes: n/a, ShareMode: Read, Delete,
AllocationSize: n/a, OpenResult: Opened
19:22:17,5158421    python.exe    4884    CreateFileMapping   
C:\Python25\Lib\site-packages\matplotlib\_path.pyd    FILE LOCKED WITH
ONLY READERS    SyncType: SyncTypeCreateSection, PageProtection:
PAGE_EXECUTE
19:22:17,5158845    python.exe    4884    CreateFileMapping   
C:\Python25\Lib\site-packages\matplotlib\_path.pyd    SUCCESS   
SyncType: SyncTypeOther
19:22:17,5160863    python.exe    4884    Load Image   
C:\Python25\Lib\site-packages\matplotlib\_path.pyd    SUCCESS    Image
Base: 0x1d2, Image Size: 0x25000
19:22:17,5163767    python.exe    4884    CloseFile   
C:\Python25\Lib\site-packages\matplotlib\_path.pyd    SUCCESS    
19:22:17,5165840    python.exe    4884    QueryOpen   
C:\Python25\Lib\site-packages\matplotlib\MSVCP71.dll    FAST IO
DISALLOWED    
19:22:17,5166951    python.exe    4884    CreateFile   
C:\Python25\Lib\site-packages\matplotlib\MSVCP71.dll    NAME NOT
FOUND    Desired Access: Read Attributes, Disposition: Open, Options:
Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete,
AllocationSize: n/a
19:22:17,5168595    python.exe    4884    QueryOpen   
C:\Windows\System32\MSVCP71.dll    FAST IO DISALLOWED    
19:22:17,5169728    python.exe    4884    CreateFile   
C:\Windows\System32\MSVCP71.dll    NAME NOT FOUND    Desired Access:
Read Attributes, Disposition: Open, Options: Open Reparse Point,
Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a
19:22:17,5171587    python.exe    4884    QueryOpen   
C:\Windows\system\MSVCP71.dll    FAST IO DISALLOWED    
19:22:17,5172995    python.exe    4884    CreateFile   
C:\Windows\system\MSVCP71.dll    NAME NOT FOUND    Desired Access: Read
Attributes, Disposition: Open, Opt

Re: [Matplotlib-users] Py2.5.4 on Win7

2009-10-24 Thread Werner F. Bruhin
Installed Py 2.6.3 and I don't see the issue there, but not all 
libraries I use are on 2.6 yet.

So, I thought lets install Python(x, y) and give this a try, but I can't 
find a Python 2.5.x version of it - is this still available?

Werner

P.S.
Will totally de-install 2.5 again and try once more.



--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Py2.5.4 on Win7

2009-10-24 Thread Werner F. Bruhin
Deinstalled 2.5.4 and installed again, same issue.  Deinstalled again 
and installed 2.5.2, both times I also deleted python25 folder.

Running barchart_demo.py directly works (c:\python25\python.exe 
pathto\barchart_demo.py).

Running it from within idle I get the same exception again:
Traceback (most recent call last):
  File "D:\Dev\aaTests\matplotlib\barchart_demo.py", line 3, in 
import matplotlib.pyplot as plt
  File "C:\Python25\Lib\site-packages\matplotlib\pyplot.py", line 6, in 

from matplotlib.figure import Figure, figaspect
  File "C:\Python25\Lib\site-packages\matplotlib\figure.py", line 16, in 

import artist
  File "C:\Python25\Lib\site-packages\matplotlib\artist.py", line 5, in 

from transforms import Bbox, IdentityTransform, TransformedBbox, 
TransformedPath
  File "C:\Python25\Lib\site-packages\matplotlib\transforms.py", line 
34, in 
from matplotlib._path import affine_transform
ImportError: DLL load failed: Le module spécifié est introuvable.

Noticed that msvcp71.dll is being installed by mpl (at least that is 
what I see in matplotlib-wininst.log).

"cd" to the folder of the script and running it again directly with 
Python I see the error again.

What could cause this?  Maybe one of the msvcp71.dll is incompatible 
with stuff already loaded by Python?

Will keep experimenting and see if I can get Boa to work with mpl

Werner





--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Py2.5.4 on Win7

2009-10-24 Thread Werner F. Bruhin
Werner F. Bruhin wrote:
> Installed Py 2.6.3 and I don't see the issue there, but not all 
> libraries I use are on 2.6 yet.
>
> So, I thought lets install Python(x, y) and give this a try, but I can't 
> find a Python 2.5.x version of it - is this still available?
>
> Werner
>
> P.S.
> Will totally de-install 2.5 again and try once more.
>   
I got it working by adding "C:\Python25" to the path environment 
variable.  Works but smells very much like a work around.

Werner



--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] 0.99.1 crashes python on Windows XP [SEC=UNCLASSIFIED]

2010-02-18 Thread Werner F. Bruhin
Hi Everyone,

On 08/10/2009 06:54, ross.wil...@ga.gov.au wrote:
> Hi Listers,
>
> I recently installed matplotlib 0.99.1 hoping to use mplot3d.  However, when 
> doing 'from mpl_toolkits.mplot3d import Axes3D' python itself crashes.  
> Reinstalling matplotlib 0.98.5 gets everything working fine, without mplot3d, 
> of course.
>
> I am running Windows XP, python 2.5.2 and numpy 1.2.1.  From the installation 
> instructions I think I have all the prerequisites.
>
> Has anyone seen behaviour like this?
>
It looks like I run into a similar issue on a client machine.

He is on Windows XP SP 2 Suisse edition and he gets "Unhandled 
Exception" error which does not show any traceback.

My application is py2exe'd, so I did another build using 0.98.5 (both 
with numpy 1.3, Python 2.5.4 and wxPython 2.8.10) but now at least we 
get a traceback:

Traceback (most recent call last):
   File "appwine.pyo", line 939, in OnToolbarChart
   File "zipextimporter.pyo", line 82, in load_module
   File "frameplotmpl.pyo", line 24, in
ImportError: cannot import name FigureCanvasWxAgg

The relevant section of frameplotmpl.py is:
from numpy import arange, sin, pi
import matplotlib as mpl
# following is already done on stats page
##mpl.use('WXAgg')
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas
from matplotlib.backends.backend_wx import NavigationToolbar2Wx
from matplotlib.dates import YearLocator, MonthLocator, DateFormatter
from matplotlib.ticker import FormatStrFormatter
from matplotlib.font_manager import FontProperties

What is really strange I can run the same .exe on my XP test machine which is 
running XP SP2 English without any problems.

I know there is not much to go by here, but would very much appreciate if 
anyone has some hints/tips on what I should look at (note that the client is 
non technical and I have no access to his machine).

Werner


--
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
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] 0.99.1 crashes python on Windows XP [SEC=UNCLASSIFIED]

2010-02-18 Thread Werner F. Bruhin
On 18/02/2010 15:12, Werner F. Bruhin wrote:
> Hi Everyone,
>
> On 08/10/2009 06:54, ross.wil...@ga.gov.au wrote:
>
>> Hi Listers,
>>
>> I recently installed matplotlib 0.99.1 hoping to use mplot3d.  However, when 
>> doing 'from mpl_toolkits.mplot3d import Axes3D' python itself crashes.  
>> Reinstalling matplotlib 0.98.5 gets everything working fine, without 
>> mplot3d, of course.
>>
>> I am running Windows XP, python 2.5.2 and numpy 1.2.1.  From the 
>> installation instructions I think I have all the prerequisites.
>>
>> Has anyone seen behaviour like this?
>>
>>  
> It looks like I run into a similar issue on a client machine.
>
> He is on Windows XP SP 2 Suisse edition and he gets "Unhandled
> Exception" error which does not show any traceback.
>
> My application is py2exe'd, so I did another build using 0.98.5 (both
> with numpy 1.3, Python 2.5.4 and wxPython 2.8.10) but now at least we
> get a traceback:
>
> Traceback (most recent call last):
> File "appwine.pyo", line 939, in OnToolbarChart
> File "zipextimporter.pyo", line 82, in load_module
> File "frameplotmpl.pyo", line 24, in
> ImportError: cannot import name FigureCanvasWxAgg
>
> The relevant section of frameplotmpl.py is:
> from numpy import arange, sin, pi
> import matplotlib as mpl
> # following is already done on stats page
> ##mpl.use('WXAgg')
> from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as 
> FigureCanvas
> from matplotlib.backends.backend_wx import NavigationToolbar2Wx
> from matplotlib.dates import YearLocator, MonthLocator, DateFormatter
> from matplotlib.ticker import FormatStrFormatter
> from matplotlib.font_manager import FontProperties
>
> What is really strange I can run the same .exe on my XP test machine which is 
> running XP SP2 English without any problems.
>
> I know there is not much to go by here, but would very much appreciate if 
> anyone has some hints/tips on what I should look at (note that the client is 
> non technical and I have no access to his machine).
>
>
The user has an AMD CPU, could this be related to the numpy issue with 
AMD machines?

Werner


--
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
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] 0.99.1 crashes python on Windows XP [SEC=UNCLASSIFIED]

2010-02-18 Thread Werner F. Bruhin
Using numpy with "/arch nosse" solved the issue.

Probably OT here, but does anyone know if numpy will in the future be 
able to dynamically switch on/off the SSEx support?

Werner


On 18/02/2010 17:31, Werner F. Bruhin wrote:
> On 18/02/2010 15:12, Werner F. Bruhin wrote:
>
>> Hi Everyone,
>>
>> On 08/10/2009 06:54, ross.wil...@ga.gov.au wrote:
>>
>>  
>>> Hi Listers,
>>>
>>> I recently installed matplotlib 0.99.1 hoping to use mplot3d.  However, 
>>> when doing 'from mpl_toolkits.mplot3d import Axes3D' python itself crashes. 
>>>  Reinstalling matplotlib 0.98.5 gets everything working fine, without 
>>> mplot3d, of course.
>>>
>>> I am running Windows XP, python 2.5.2 and numpy 1.2.1.  From the 
>>> installation instructions I think I have all the prerequisites.
>>>
>>> Has anyone seen behaviour like this?
>>>
>>>
>>>
>> It looks like I run into a similar issue on a client machine.
>>
>> He is on Windows XP SP 2 Suisse edition and he gets "Unhandled
>> Exception" error which does not show any traceback.
>>
>> My application is py2exe'd, so I did another build using 0.98.5 (both
>> with numpy 1.3, Python 2.5.4 and wxPython 2.8.10) but now at least we
>> get a traceback:
>>
>> Traceback (most recent call last):
>>  File "appwine.pyo", line 939, in OnToolbarChart
>>  File "zipextimporter.pyo", line 82, in load_module
>>  File "frameplotmpl.pyo", line 24, in
>> ImportError: cannot import name FigureCanvasWxAgg
>>
>> The relevant section of frameplotmpl.py is:
>> from numpy import arange, sin, pi
>> import matplotlib as mpl
>> # following is already done on stats page
>> ##mpl.use('WXAgg')
>> from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as 
>> FigureCanvas
>> from matplotlib.backends.backend_wx import NavigationToolbar2Wx
>> from matplotlib.dates import YearLocator, MonthLocator, DateFormatter
>> from matplotlib.ticker import FormatStrFormatter
>> from matplotlib.font_manager import FontProperties
>>
>> What is really strange I can run the same .exe on my XP test machine which 
>> is running XP SP2 English without any problems.
>>
>> I know there is not much to go by here, but would very much appreciate if 
>> anyone has some hints/tips on what I should look at (note that the client is 
>> non technical and I have no access to his machine).
>>
>>
>>  
> The user has an AMD CPU, could this be related to the numpy issue with
> AMD machines?
>
> Werner
>
>
> --
> 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
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
>



--
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
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] py2exe problems for a tkinter/matpotlib project - works for me, but not for others

2010-03-15 Thread Werner F. Bruhin

Hi Kim,

On 15/03/2010 10:57, Kim Hansen wrote:

Hi group,
I have previously had success with py2exe and matplotlib, using a
specialized setup.py like the attached one (which is adapted from
http://www.py2exe.org/index.cgi/MatPlotLib).
However, now I have tried to go a step further and integrate some
Tkinter controls in the GUI for a prototype, see attached alphabeta.py
If I do a python setup.exe py2exe with this setup file on the attached
Tkinter/matplotlib and alphabeta.exe is successfully created.
However, it does not run for everyone else:
Myself: Works like a charm
A user with a python environment who make py2exes himself: Crashes on
startup with the attached error log
A user with just a Python environment: Works!
A user with no Python environment: Crashes on startup with the same log.
The log does not give me any good ideas as to how I could modify
setup.py to get it working.
Any good ideas?

Changing the line 560 in mathtext.py from:
 font = FT2Font(basename)
to:
 font = FT2Font(str(basename))

Fixed it for me, I don't know what FT2Font does and why this matters - 
hopefully someone else can expand on this.


Attached your setup.py a bit simplified as you are using matplotlib 0.99.

Werner

'''
Created on 25/01/2010

@author: kha
'''
from distutils.core import setup
import py2exe
import shutil

# We need to import the glob module to search for all files.
import glob

# Remove the build and dist folder, old stuff in there is bitting me once to often:)
shutil.rmtree("build", ignore_errors=True)
shutil.rmtree("dist", ignore_errors=True)

# We need to exclude matplotlib backends not being used by this executable.  You may find
# that you need different excludes to create a working executable with your chosen backend.
# We also need to include include various numerix libraries that the other functions call.
 
opts = {
'py2exe': { "includes" : [],
"excludes": ['_gtkagg', '_tkagg', '_agg2', '_cairo', '_cocoaagg',
  '_fltkagg', '_gtk', '_gtkcairo', ],
"dll_excludes": ['libgdk-win32-2.0-0.dll',
  'libgobject-2.0-0.dll'],
   }
}

# matplotlib data
# use mpl's get_py2exe_datafiles()
import matplotlib as mpl
data_files = mpl.get_py2exe_datafiles()

# for console program use 'console = [{"script" : "scriptname.py"}]
setup(windows=[{"script" : "alphabeta.py"}], options=opts, data_files=data_files)

--
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
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] py2exe problems for a tkinter/matpotlib project - works for me, but not for others

2010-03-15 Thread Werner F. Bruhin

On 15/03/2010 14:37, Kim Hansen wrote:

Hi Werner

2010/3/15 Werner F. Bruhin <mailto:werner.bru...@free.fr>>


Hi Kim,


Changing the line 560 in mathtext.py from:
   font = FT2Font(basename)
to:
   font = FT2Font(str(basename))

Fixed it for me, I don't know what FT2Font does and why this
matters - hopefully someone else can expand on this.

This worked here as well - sort of, at least.
It was just a guess, as I noticed that the other call to FT2Font is 
using str too.
It does not crash anymore, but the LaTeX $\alpha-\beta$ in the title 
is not rendered correctly in the title of the graph for the users who 
had problems before.

Yeap, I see this now too.

I guess it must be due to some fonts not being available in the dist, 
which are available to me and others. I do not know if there is a way 
to patch up setup.py such that the needed fonts are included in the dist?
It should be there, i.e. mpl-data in the lib/site-packages/matplotlib 
folder has the same number of files and folders as the one created by 
setup.py in dist.


But it obviously doesn't find it or some other setting to handle the 
LaTex stuff is not there.


Put this at the top of alphabeta.py, i.e. just after import matplotlib

matplotlib.verbose.level = u'debug'

and change setup.py to generate a console app.  If I run this on my dev 
machine the output shows that fonts are found, but if I run it on the 
py2exe'd version lots of STIX fonts are not found.  Even so these fonts 
are in mpl-data/fonts/ttf of the py2exe dist folder.


So, I think/guess that the font searching is not done correctly, as 
running with verbose "debug" it shows that it finds the mpl-data folder 
in the dist folder or wherever you copy dist too.


Hopefully someone who knows how the font searching is done can help 
out/point to the culprit.


Attached your setup.py a bit simplified as you are using
matplotlib 0.99.

Thank you. I am using your setup.py now. It was very kind of you to 
send that.

You are welcome
Werner
--
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
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Tick label on left and right for yaxis?

2010-03-18 Thread Werner F. Bruhin
Looking at set_ticks_position doc it says that "default" will reset 
ticks to be on both sides and labels on left, and set_label_position 
only allows for left or right.

Is there any way to have ticks and ticks labels on both left and right?

Werner


--
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
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] py2exe and matplotlib errors when executing exe

2010-05-19 Thread Werner F. Bruhin
On 19/05/2010 01:17, New2Python wrote:
> Thanks, I changed the matplotlibrc file to use the WXAgg backend and then had
> to copy the file into the mpl.get_configdir() and in my local working dir
> for it to work.
>
> The file runs however a python error screen pops up and then closes without
> giving me the chance to read it, anybody know how to stop the window from
> closing so quickly
>
You have probably set "wx.App(redirect=True)", change to "False" and 
then you should see the exception in your IDE.

Werner


--

___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] PY2EXE with Matplotlib and wxPython compiles but won't run???

2010-05-19 Thread Werner F. Bruhin

On 19/05/2010 19:55, David Grudoski wrote:
I'm trying to build an executable using PY2EXE; running Python 2.5.2 
and wxPython 2.8.10.1 and MatplotLib 0.99.0
I tried using the setup.py from the PY2EXE.org Matplotlib page and 
although everything compiles correctly and generates an executable.

When I launch the executable I get the following error:

"The application requires a version of wxPython greater than or equal 
to 2.8, but a matching version was not found."

You currently have these version(s) installed.


I can compile an executable with PY2EXE and wxPython that works fine, 
but apparantly somethins in the setup for matplotlib is causing a problem.


Has anyone else seen this problem or know of a solution?

You need to patch matplotlib (backend_wx.py), see the bottom of this page:
http://www.py2exe.org/index.cgi/MatPlotLib

Werner
--

___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] PY2EXE with Matplotlib and wxPython compiles but won't run???

2010-05-20 Thread Werner F. Bruhin
On 19/05/2010 20:45, David wrote:
> Werner F. Bruhin  writes:
>
>
>>
>> On 19/05/2010 19:55, David Grudoski wrote:
>>
>>I'm trying to build an executable using
>> PY2EXE; running Python 2.5.2 and wxPython 2.8.10.1 and MatplotLib 0.99.0
>>I tried using the setup.py from the
>> PY2EXE.org Matplotlib page and although everything compiles correctly
>> and generates an executable.
>>When I launch the executable I get the
>> following error:
>>
>>"The application requires a version of
>> wxPython greater than or equal to 2.8, but a matching version was not
>> found."
>>You currently have these version(s)
>> installed.
>>
>>
>>
>>
>>I can compile an executable with PY2EXE and
>> wxPython that works fine, but apparantly somethins in the setup for
>> matplotlib is causing a problem.
>>
>>Has anyone else seen this problem or know of
>> a solution?
>>
>> You need to patch matplotlib (backend_wx.py), see the bottom of this
>> page:http://www.py2exe.org/index.cgi/MatPlotLib
>> Werner
>>
>>
>> --
>>
>>
>>
>> ___
>> Matplotlib-users mailing list
>> matplotlib-us...@...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>>  
> Thanks for the reply Werner,
> I decided to try and construct the executable from the site using the
> "embedding_in_wx2.py" example. Again making sure the patch was in place on the
> backend_wx.py I again ran the python setup.py py2exe and everything compiled.
> Now when I run the exe it generate the following log file errors:
> Traceback (most recent call last):
>File "embedding_in_wx2.py", line 21, in
>File "zipextimporter.pyo", line 82, in load_module
>File "matplotlib\backends\backend_wxagg.pyo", line 20, in
>File "zipextimporter.pyo", line 82, in load_module
>File "matplotlib\figure.pyo", line 19, in
>File "zipextimporter.pyo", line 82, in load_module
>File "matplotlib\axes.pyo", line 14, in
>File "zipextimporter.pyo", line 82, in load_module
>File "matplotlib\collections.pyo", line 21, in
>File "zipextimporter.pyo", line 82, in load_module
>File "matplotlib\backend_bases.pyo", line 32, in
>File "zipextimporter.pyo", line 82, in load_module
>File "matplotlib\widgets.pyo", line 12, in
>File "zipextimporter.pyo", line 82, in load_module
>File "matplotlib\mlab.pyo", line 376, in
> TypeError: unsupported operand type(s) for %: 'NoneType' and 'dict'
>
This is due to using "optimize 1 or 2" in py2exe, the work around is to 
fix four lines in mpl.mlab.py as shown on the wiki page mentioned in the 
last thread.

Werner


--

___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] text element just above previous text element

2010-11-08 Thread Werner F. Bruhin
I like to have 2 or 3 text elements "stacked" on top of each other on 
top of a bar.

Currently it works for the first text element by doing:

height = bar.get_height()
xCorr = bar.get_x()
yCorr = 0.20 + height

txtax = axes.text(xCorr, yCorr, hstr)

trying to add the second text just above the previous one I tried this:

pCorr = yCorr + txtax.get_size() + 0.4
txtax = axes.text(xCorr, pCorr, hstrPerc)

It looks like my problem is that get_x() returns a value in ticks and 
txtax.get_size() is in pixels and I can't find a way to get at the 
height of the text element in ticks.

Can anyone please push me in the right direction.

Werner




--
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a 
Billion" shares his insights and actions to help propel your 
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] text element just above previous text element

2010-11-09 Thread Werner F. Bruhin
Finally figured it out after pulling some hear.

Using "axes.annotate" instead of "axes.text" worked for me, i.e. 
something like this:

axes.annotate(hstr, xy=(xCorr, yCorr), xytext=(0, 5), textcoords='offset 
points')

instead of what I did originally.

Werner

On 08/11/2010 16:21, Werner F. Bruhin wrote:
> I like to have 2 or 3 text elements "stacked" on top of each other on
> top of a bar.
>
> Currently it works for the first text element by doing:
>
> height = bar.get_height()
> xCorr = bar.get_x()
> yCorr = 0.20 + height
>
> txtax = axes.text(xCorr, yCorr, hstr)
>
> trying to add the second text just above the previous one I tried this:
>
> pCorr = yCorr + txtax.get_size() + 0.4
> txtax = axes.text(xCorr, pCorr, hstrPerc)
>
> It looks like my problem is that get_x() returns a value in ticks and
> txtax.get_size() is in pixels and I can't find a way to get at the
> height of the text element in ticks.
>
> Can anyone please push me in the right direction.
>
> Werner
>
>
>
>
> --
> The Next 800 Companies to Lead America's Growth: New Video Whitepaper
> David G. Thomson, author of the best-selling book "Blueprint to a
> Billion" shares his insights and actions to help propel your
> business during the next growth cycle. Listen Now!
> http://p.sf.net/sfu/SAP-dev2dev
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>



--
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a 
Billion" shares his insights and actions to help propel your 
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] RuntimeError: failed to gain raw access

2010-12-08 Thread Werner F. Bruhin
Using mpl 0.99.1 and sometimes get the following exception.

Traceback (most recent call last):
   File "C:\Python26\lib\site-packages\wx-2.8-msw-unicode\wx\_core.py", 
line 14640, in 
 lambda event: event.callable(*event.args, **event.kw) )
   File "C:\dev\TwcbBranchesV32\Program\panelstats.py", line 385, in 
RefreshAllGraphs
 self.RefreshCountryValue(self.countryValueP, self.countryValue)
   File "C:\dev\TwcbBranchesV32\Program\panelstats.py", line 417, in 
RefreshCountryValue
 self.DoStatsParetoAlt(sql, panel, axes, _('Value - in home 
currency'), _('Purchase value in % of cumulated purchase value'), avg=True)
   File "C:\dev\TwcbBranchesV32\Program\panelstats.py", line 992, in 
DoStatsParetoAlt
 panel.canvas.draw()
   File 
"C:\Python26\lib\site-packages\matplotlib\backends\backend_wxagg.py", 
line 61, in draw
 self.bitmap = _convert_agg_to_wx_bitmap(self.get_renderer(), None)
   File 
"C:\Python26\lib\site-packages\matplotlib\backends\backend_wxagg.py", 
line 229, in _py_WX28_convert_agg_to_wx_bitmap
 agg.buffer_rgba(0, 0))
   File "C:\Python26\lib\site-packages\wx-2.8-msw-unicode\wx\_gdi.py", 
line 908, in BitmapFromBufferRGBA
 return _gdi_._BitmapFromBufferRGBA(width, height, dataBuffer)
RuntimeError: Failed to gain raw access to bitmap data.

I thought/guessed it had to do with not having resized the canvas 
correctly, but I am not sure and the following code is run whenever I 
resize the parent of the canvas.

 def _SetSize( self ):
 pixels = tuple( self.parent.GetClientSize() )
 self.SetSize( pixels )
 self.canvas.SetSize( pixels )
 self.figure.set_size_inches( float( pixels[0] 
)/self.figure.get_dpi(),
  float( pixels[1] 
)/self.figure.get_dpi() )


What could the cause of this error be?

Werner


--
What happens now with your Lotus Notes apps - do you make another costly 
upgrade, or settle for being marooned without product support? Time to move
off Lotus Notes and onto the cloud with Force.com, apps are easier to build,
use, and manage than apps on traditional platforms. Sign up for the Lotus 
Notes Migration Kit to learn more. http://p.sf.net/sfu/salesforce-d2d
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] http://matplotlib.sourceforge.net/users_guide_0.87.1.pdf

2006-07-06 Thread Werner F. Bruhin
I tried multiple times to download the above and/or to just view it with 
Adobe 7 but it looks like the file is corrupted.

Can anyone confirm this or is the problem on my side?

Werner


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
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] http://matplotlib.sourceforge.net/users_guide_0.87.1.pdf

2006-07-06 Thread Werner F. Bruhin
Just tried again using GetRight download manager and did manage to 
download it.  Just FYI, GetRight reported multiple disconnects due to 
busy server, but as it allows to resume this was not a problem.

Werner

Werner F. Bruhin wrote:
> I tried multiple times to download the above and/or to just view it with 
> Adobe 7 but it looks like the file is corrupted.
> 
> Can anyone confirm this or is the problem on my side?
> 
> Werner
> 
> 
> 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


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
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] wxmsw26uh_vc.dll and matplotlib 0.87

2006-07-06 Thread Werner F. Bruhin
Trying to py2exe the application I get an error no such file 
"wxmsw26uh_vc.dll".

I am on:
# Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit (Intel)]
# wxPython 2.6.3.2, Boa Constructor 0.4.4

Part of the changes I made inludes trying out numpy 0.8.9.

What is this dll for and where should it be?  The name looks like it is 
part of wxWidget but I can't seem to find it.


Werner


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
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] wxmsw26uh_vc.dll and matplotlib 0.87

2006-07-06 Thread Werner F. Bruhin
Werner F. Bruhin wrote:

> Trying to py2exe the application I get an error no such file 
> "wxmsw26uh_vc.dll".
> 
> I am on:
> # Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit (Intel)]
> # wxPython 2.6.3.2, Boa Constructor 0.4.4
> 
> Part of the changes I made inludes trying out numpy 0.8.9.
> 
> What is this dll for and where should it be?  The name looks like it is 
> part of wxWidget but I can't seem to find it.

Googling on it I found that it is included with wxPython Unicode.

What is needed to tell matplotlib not to use Unicode?  Is this still 
possible with 0.87?

Werner

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


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
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] numpy and matplotlib 0.87

2006-07-06 Thread Werner F. Bruhin
I got this to work, only issue left is the py2exe problem (see other post).

Looking through the matplotlib 0.87 doc (page 13) it mentioned that one 
should use an appropriate package for the numeric package one uses, but 
I can't see see these packages.

Is it that the doc is just a bit out of date?

FYI, the section 1.2 Numerix does also not mention numpy.

Werner


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
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] wxmsw26uh_vc.dll and matplotlib 0.87

2006-07-06 Thread Werner F. Bruhin
Hi,

Charlie Moad wrote:
> As you have found, the matplotlib binaries are built using the unicode
> version of wxpython.  If you are not using blitting, then you can just
> go in any delete the "matplotlib/backends/_wxagg.so" (.pyd for
> windows) file from the installed matplotlib module.  Then the
> pure-python wx backend will be used instead, and it should work fine
> with both versions of wx.
I can run it without problem on my dev machine.  The problem is when 
packaging it with py2exe, worked around this one by just excluding that 
dll, but maybe this is the cause of the problem - see other thread.

Werner
> 
> - Charlie
> 
> On 7/6/06, Werner F. Bruhin <[EMAIL PROTECTED]> wrote:
> 
>>Werner F. Bruhin wrote:
>>
>>
>>>Trying to py2exe the application I get an error no such file
>>>"wxmsw26uh_vc.dll".
>>>
>>>I am on:
>>># Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit (Intel)]
>>># wxPython 2.6.3.2, Boa Constructor 0.4.4
>>>
>>>Part of the changes I made inludes trying out numpy 0.8.9.
>>>
>>>What is this dll for and where should it be?  The name looks like it is
>>>part of wxWidget but I can't seem to find it.
>>
>>Googling on it I found that it is included with wxPython Unicode.
>>
>>What is needed to tell matplotlib not to use Unicode?  Is this still
>>possible with 0.87?
>>
>>Werner
>>
>>
>>>
>>>Werner
>>>
>>>
>>>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
>>
>>
>>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
>>Matplotlib-users@lists.sourceforge.net
>>https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
> 
> 
> 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


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
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] matplotlib, numpy and py2exe

2006-07-06 Thread Werner F. Bruhin
I finally managed to build it without getting py2exe errors.

Needed to include package "numpy" and remove "distutils" package from 
numpy as py2exe was failing on "tests" - maybe this is not the right 
thing to do as I still get run time error when running the exe.

Here is the exception I currently get:
 Thu Jul 06 17:43:19 2006 
Traceback (most recent call last):
   File "appwine.pyo", line 1333, in OnToolbarChart
   File "frameplotmpl.pyo", line 16, in ?
   File "matplotlib\numerix\__init__.pyo", line 66, in ?
   File "numpy\__init__.pyo", line 35, in ?
   File "numpy\_import_tools.pyo", line 173, in __call__
   File "numpy\_import_tools.pyo", line 68, in _init_info_modules
   File "", line 1, in ?
   File "numpy\random\__init__.pyo", line 3, in ?
   File "numpy\random\mtrand.pyo", line 12, in ?
   File "numpy\random\mtrand.pyo", line 10, in __load
   File "numpy.pxi", line 32, in mtrand
AttributeError: 'module' object has no attribute 'dtype'

As mtrand is a .pyd I run out of things to try.

Any hints on how to get around this one would be appreciated, otherwise 
I guess I will go back an use Numeric instead.

Werner


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
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] wxmsw26uh_vc.dll and matplotlib 0.87

2006-07-06 Thread Werner F. Bruhin
A little update.

Werner F. Bruhin wrote:
> Trying to py2exe the application I get an error no such file 
> "wxmsw26uh_vc.dll".
> 
> I am on:
> # Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit (Intel)]
> # wxPython 2.6.3.2, Boa Constructor 0.4.4
> 
> Part of the changes I made inludes trying out numpy 0.8.9.
> 
> What is this dll for and where should it be?  The name looks like it is 
> part of wxWidget but I can't seem to find it.
Can not get it to work with numpy (see other thread), however using 
Numeric with the following py2exe setup.py sections looks like it works 
even using an Ansi wxPython version (my app uses a database, while I am 
planning to switch to Unicode, I don't have time for this at the moment).

The matplotlib related entries in the options section are "pytz" and 
"matplotlib.numerix" and the exclude of the wxmsg26uh_vc.dll".

# options for py2exe
options = {"py2exe": {"compressed": 1,
   "optimize": 2,
   "packages": ["encodings",
"kinterbasdb",
"pytz", "matplotlib.numerix",
],
   "excludes": ["MySQLdb", "Tkconstants", "Tkinter", 
"tcl",
"orm.adapters.pgsql", 
"orm.adapters.mysql"
   ],
   "dll_excludes": ["tcl84.dll", "tk84.dll", 
"wxmsw26uh_vc.dll"]
   }
   }
zipfile = r"lib\library.zip"

And this is the setup section (with some stuff omitted):
setup(
   classifiers = ["Copyright:: Werner F. Bruhin",
...
  "Natural Language :: English"],
   windows = [twcb],
   #console = [twcb],
   options = options,
   zipfile = zipfile,
   data_files = [("prog\\locale\\fr\\LC_MESSAGES",
mylocaleFR),
...
 matplotlib.get_py2exe_datafiles(),
 ("prog\\amaradata", amaradata),
 ("prog\\amaradata\\Schemata", amaraschemata),
     ]
 )

I am using py2exe 0.6.5, wxPython 2.6.3.2 and Python 2.4.

Need to do further testing with it, but the matplotlib plots (some line 
and pie charts - nothing very sophisticated) work fine.

Will give numpy another try, if I get some hints on how to overcome the 
issue reported in another thread.

Werner


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
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplotlib, numpy and py2exe

2006-07-06 Thread Werner F. Bruhin
Hi James,

Thanks for the hints.

James Carroll wrote:

> Hi Werner,
>
> I got this problem too, and I actually updated the py2exe wiki on what
> to do when you see it.  The problem is that there are multiple _sort
> modules (_sort.pyd in numpy and others in the different numer*
> packages.)  Only some of them have dtype.
>
> See the last section (seciton 5) of
> http://starship.python.net/crew/theller/moin.cgi/MatPlotLib

I have seen that, but it doesn't help.

I have only Numeric and numpy on my system.  I only need one, just 
wanted to get up to date, so tried changing from Numeric to numpy.  For 
testing I rename the folder of the one I don't want to use, so py2exe 
nor matplotlib can not find it.

I don't have a real need to change, so for the moment I will stay with 
Numeric and if I don't run into other problems with matplotlib 0.87.3 I 
stay with it otherwise I will go back to the version I used before and 
upgrade when I get around to move over to wxPython Unicode.

Werner

>
> My real solution to it was to remove all the other num* packages from
> the system and just have numpy and scipy installed.  This ensured that
> I wasn't pulling in the other packges by accident.
>
> -Jim
>
>
> On 7/6/06, Werner F. Bruhin <[EMAIL PROTECTED]> wrote:
>
>> I finally managed to build it without getting py2exe errors.
>>
>> Needed to include package "numpy" and remove "distutils" package from
>> numpy as py2exe was failing on "tests" - maybe this is not the right
>> thing to do as I still get run time error when running the exe.
>>
>> Here is the exception I currently get:
>>  Thu Jul 06 17:43:19 2006 
>> Traceback (most recent call last):
>>File "appwine.pyo", line 1333, in OnToolbarChart
>>File "frameplotmpl.pyo", line 16, in ?
>>File "matplotlib\numerix\__init__.pyo", line 66, in ?
>>File "numpy\__init__.pyo", line 35, in ?
>>File "numpy\_import_tools.pyo", line 173, in __call__
>>File "numpy\_import_tools.pyo", line 68, in _init_info_modules
>>File "", line 1, in ?
>>File "numpy\random\__init__.pyo", line 3, in ?
>>File "numpy\random\mtrand.pyo", line 12, in ?
>>File "numpy\random\mtrand.pyo", line 10, in __load
>>File "numpy.pxi", line 32, in mtrand
>> AttributeError: 'module' object has no attribute 'dtype'
>>
>> As mtrand is a .pyd I run out of things to try.
>>
>> Any hints on how to get around this one would be appreciated, otherwise
>> I guess I will go back an use Numeric instead.
>>
>> Werner
>>
>>
>> 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
>> Matplotlib-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>
>


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
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] dynamic_image_wxagg.py not closing - fixed

2006-09-28 Thread Werner F. Bruhin

Attached is an updated version which does close.

I move the timer code and added and EVT_CLOSE which stops the timer and 
now it closes correctly.


Werner


dynamic_image_wxagg.py
Description: application/python
-
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
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] matplotlib 0.87.6 and wxPython

2006-09-29 Thread Werner F. Bruhin
Second sending (to list instead of gmane) - sorry if this gets through 
twice, but sent it yesterday and until this morning would not see it.  I 
am including indiv. files instead of zip (maybe zip's are blocked?).


Just downloaded the latest build to start testing my things with Python 2.5.

I also installed the examples.zip for 87.1 and found that they were
still using "from wxPython import *" which is deprecated as of wxPython
2.7.  I upgraded some of them to "import wx" and included them in the
attached zip file, there are some (using XRC which I did not upgrade as
I don't know how the XRC stuff works, it also uses the old style import).

Note that the "dynamic_image_wxagg.py" example does not close when
clicking on the "X".  Will keep looking and try to figure out why.

Some of these examples give me the "wxmsg26uh_vc.dll" not found error.
I thought having seen some messages explaining how to deactive the use
of unibol version of wxPython but can't find it.

BTW, will there be a build for Python 2.5 and wxPython 2.7 Unibol (which
is what I used for testing - see below)?

Best regards
Werner

P.S. version info:
# Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)]
# wxPython 2.7.0.1pre.20060923, Boa Constructor 0.4.4



embedding_in_wx4.py
Description: application/python


embedding_in_wx.py
Description: application/python


wxcursor_demo.py
Description: application/python


dynamic_image_wxagg2.py
Description: application/python


embedding_in_wx2.py
Description: application/python
-
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
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplotlib version info

2006-10-30 Thread Werner F. Bruhin
Stephen,

On the dev list was an ANN post which stated that 0.87.7:

This release is compiled against numpy-1.0 final.  The binaries are
fresh on sourceforge, so they may take some time to propagate to the
mirrors.

http://cheeseshop.python.org/pypi/matplotlib/
http://sourceforge.net/project/showfiles.php?group_id=80706&package_id=82474

Note: There is a compile error on python2.3 that will probably require
a slight modification to the released source.  Please allow some time
for us to fix this and post the binaries.

Werner

Stephen Uhlhorn wrote:
> Sorry if this has been answered already, but I'm having trouble
> finding the answer--
> 
> What version of matplotlib is compatible with numpy 1.0 (final)? Or,
> should I continue to use numpy-1.0rc2 w/ mpl 0.87.7? I'm building from
> source on mac os using fink, and have had no trouble until numpy
> 1.0rc3 came out.
> 
> -stephen
> 
> -
> 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


-
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
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] wxmsw26uh_vc.dll

2006-11-04 Thread Werner F. Bruhin




Hi Charlie,

Charlie Moad wrote:

  Installing the unicode version of wxpython is the solution.  This will
get rid of the error message.  Matplotlib is compiled against it.
  

Isn't this a maint headache for you and others maintaining matplotlib?

Will there be wxPython 2.6, 2.7 and 2.8 builds?

Is it not possible to have a wxPython nutral build?

Best regards
Werner



  
On 11/4/06, Etrade Griffiths <[EMAIL PROTECTED]> wrote:
  
  
Hi

running Win XP, Python 2.4 with matlibplot and wxpython installed from
these executables both down-loaded from sourceforge

matplotlib-0.87.7.win32-py2.4.exe
wxPython2.6-win32-ansi-2.6.3.3-py24.exe

Just taking the first steps with matplotlib and wxpython using
wxmpl.  Running one of the wxmpl test apps I get this error message

python.exe - Unable to locate component

"This application has failed to start because wxmsw26uh_vc.dll was not
found.  Reinstalling this application may fix this problem"

After dismissing the message box, the app pops up and runs OK so I guess
the error is not that serious but still pretty irritating to users.  Tried
reinstalling but that doesn't help.  Also did a google search on
wxmsw26uh_vc.dll and it seems that several people have reported this
problem but I couldn't find a solution.  One of the discussions I did find
mentioned unicode versions of wxpython but AFAIK I have never installed a
unicode version.

All suggestions gratefully received!



-
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
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


  
  
-
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
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users



  






-
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
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] wxmsw26uh_vc.dll

2006-11-05 Thread Werner F. Bruhin
Hi Charlie,

Charlie Moad wrote:

> ...

> I hope not.  I am guessing that wxPython is like the linux kernel, so
> 2.7 is a dev branch.

Yes, 2.7 is a dev branch which normally lasts for quit some time, 
however this time round they are hoping to move to 2.8 pretty quickly, I 
believe before the end of the year.

>
>>  Is it not possible to have a wxPython nutral build?
>
>
> The native interface was  added for high speed blitting/animation.  A
> while back we talked about and agreed on trying to remove the native
> interfaces for gtk and wxpython to avoid these compilation headaches.
> This was after having decent success with pure python approaches for
> qt3 and qt4.  We are sticking with the unicode wxpython build for the
> remainder of 0.87.x to avoid more confusion.  Ideally 0.88 will have
> the pure python blitting implementations.

That is good news.

Best regards
Werner


-
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
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] font_manager.py gives following traceback

2006-12-13 Thread Werner F. Bruhin
I have received reports from clients with the following traceback or 
similar.

This happens when application is packaged with py2exe.

Traceback (most recent call last):
  File "appwine.pyo", line 1341, in OnToolbarChart
  File "frameplotmpl.pyo", line 19, in ?
  File "matplotlib\backends\__init__.pyo", line 19, in ?
  File "matplotlib\backends\backend_wxagg.pyo", line 18, in ?
  File "matplotlib\backends\backend_agg.pyo", line 82, in ?
  File "matplotlib\figure.pyo", line 3, in ?
  File "matplotlib\axes.pyo", line 14, in ?
  File "matplotlib\axis.pyo", line 21, in ?
  File "matplotlib\font_manager.pyo", line 982, in ?
  File "matplotlib\font_manager.pyo", line 826, in __init__
  File "matplotlib\font_manager.pyo", line 819, in rebuild
  File "matplotlib\font_manager.pyo", line 454, in createFontDict
SystemError: error return without exception set

Any hints of what might cause this would be very welcome.

Werner

P.S.
I am still on matplotlib version  '0.82' (plan to upgrade to newer 
version but need to upgrade to Unicode wxPython first), with Python 2.4 
and wxPython 2.6.x


-
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
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] freezing matplotlib

2007-02-02 Thread Werner F. Bruhin

Hi,

Emmanuel Favre-Nicolin wrote:

Le lundi 25 décembre 2006 16:00, Allan Noriel Estrella a écrit :
  

Has anyone tried freezing matplotlib embedded in a wx app (using py2ece,
cx_freeze or pyinstaller)? The setup.py in the FAQ seems to be outdated. I
want to freeze the embedding_in_wx.py in the examples. Do you have any
suggestions or cookbook steps that I can follow?



it looks there were no answer to your question!

I tried too the FAQ 
http://matplotlib.sourceforge.net/faq.html#PY2EXE


and it does not work at least with my enthough installation directories seems 
to be very different from the one suggested.


I also tried http://www.py2exe.org/index.cgi/MatPlotLib without success

I tried the simpelst thing 


from pylab import *
plot([1,2,3])
show()

no chance!
I don't know if someone could help, is there a better backend for freezing, 
maybe wxpython?


Someone already succeded with a recent matplotlib ?
I'm using 0.87.3 (on windows)
  
I am way behind on matplotlib version (still on 0.82) but here is an 
example setup.py to freeze the matplotlib sample wxcursor_demo.py 
(included just in case it changed).


I just have no time yet to upgrade to a newer version, especially as I 
want to upgrade to wxPython 2.8 at the same time.


Here a fews things I recall from my tests with 0.87.3:
- you need to use the unicode build of wxPython (also this might have or 
will change).
- matplotlib data folder handling (see in setup.py commented line in 
data_files section)
- numpy  (just tried it building against 87.3 but get errors related to 
numpy, one probably has to force more inclusions)


Hope this helps
Werner


setup.py
Description: application/python


wxcursor_demo.py
Description: application/python
-
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
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


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

2007-02-07 Thread Werner F. Bruhin
Hi Charlie,

Great to see a new release, will put some time aside to test it with 
wxPython early next week.

I can't see a reference to the wxPython backend, will it still require 
the Unicode build or can one use the Ansi build and which versions of 
wxPython are supported?

Werner

-
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
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


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

2007-02-07 Thread Werner F. Bruhin
Charlie Moad wrote:
> On 2/7/07, Werner F. Bruhin <[EMAIL PROTECTED]> wrote:
>> Hi Charlie,
>>
>> Great to see a new release, will put some time aside to test it with
>> wxPython early next week.
>>
>> I can't see a reference to the wxPython backend, will it still require
>> the Unicode build or can one use the Ansi build and which versions of
>> wxPython are supported?
>
> Well, we haven't built any binaries yet.  We pushed a source release
> fast to try to get it into Feisty.  Sorry Chris!  With wx2.8 out now
> and this being a major release, we definitely need to rethink wx
> builds.  We stuck with unicode for 0.87 to avoid confusion.  I would
> be happy to hear what wx users think/want.

For me the ideal would be not to be depended on a particular release of 
wxPython - big surprise no :-) .
If I understand it correctly the dependency came in for performance 
optimization, does 2.8 change something for this.
- If yes, I would not see a problem with 0.9 requiring as a minimum 
2.8.0.1 but going forward I could use any 2.8.x or newer release.
- If no, then I guess we have to live with having a "fixed" dependency, 
e.g. 0.87 is wxPython 2.6.x, 0.90 is wxPython 2.8.x, but it should 
through at least a warning if one tries to use it with another wxPython 
release.

Werner


-
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
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] testing of matplotlib 0.90 - on Win XP and Python 2.5

2007-02-14 Thread Werner F. Bruhin
I just downloaded the 0.9 binary and did some testing and also updated 
all the wx examples to use the new wx namespace (i.e. change from "from 
wxPython.wx import *" to "import wx".


dynamic_demo_wx.py
- changed name space using Boa's conversion tool
- moved the timer stuff to __init__, saved a reference and stop the 
timer on close, so that this shuts down correctly.


dynamic_demo_wxagg2.py
- changed name space using Boa's conversion tool
- complains about wxmsw26uh_vc.dll, but runs if one clicks on OK

dynamic_demo_wxagg.py
- changed name space using Boa's conversion tool
- complains about wxmsw26uh_vc.dll, but runs if one clicks on OK

embedding_in_wx.py
- changed name space using Boa's conversion tool
- screen update/refresh is for some reason very slow

embedding_in_wx2.py
- changed name space using Boa's conversion tool
- complains about wxmsw26uh_vc.dll, but runs if one clicks on OK

embedding_in_wx3.py
- changed name space using Boa's conversion tool
- manually made changes regarding XRC as it is not handled by the 
conversion tool
- can't get it to work, as think it is because 
"data/embedding_in_wx3.xrc" is not found - it is not included in the zip?!


embedding_in_wx4.py
- changed name space using Boa's conversion tool
- complains about wxmsw26uh_vc.dll, but runs if one clicks on OK

simple3d_oo.py
- changed name space using Boa's conversion tool
- complains about wxmsw26uh_vc.dll, but runs if one clicks on OK


If someone could take the enclosed and maybe create an updated examples.zip

When a build for wxPython 2.8 is available I will do some more testing, 
especially with regards to py2exe packaging.


Werner


dynamic_demo_wx.py
Description: application/python


dynamic_image_wxagg2.py
Description: application/python


dynamic_image_wxagg.py
Description: application/python


embedding_in_wx.py
Description: application/python


embedding_in_wx2.py
Description: application/python


embedding_in_wx4.py
Description: application/python


simple3d_oo.py
Description: application/python
-
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
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] testing of matplotlib 0.90 - on Win XP and Python 2.5

2007-02-15 Thread Werner F. Bruhin
Hi Chris,

Christopher Barker wrote:
> Thanks for doing this, the wx back-ends are a bit neglected at the 
> moment.
>
> Which version of wxPython did you test this all on? We really need 
> some work/testing with 2.8.*, I now there are some issues on OS-X, but 
> I haven't tried it anywhere else yet.
Tests were done with:
# Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)]
# wxPython 2.8.1.1, Boa Constructor 0.5.2

That is the ANSI build of wxPython.  As soon as there is a matplotlib 
build with 2.8 I will do more testing, can then use either ANSI or Unicode.

Werner

-
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
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


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

2007-02-21 Thread Werner F. Bruhin
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. Of course, that wont' do it if I dont' get around to fiing a 
> bug report!
>
> wxPython includes a wxversion module that lets one select whihc version 
> of wxPython you want run, if more than one is installed. It might be 
> nice if those calls could get put into MPL somewhere, so that when MPL 
> is built against a given version, that version will be run.
>   
If someone can do a Windows build against a wxPython 2.8 version (and
Python 2.5) I could do some testing.

Is there a list of what the problems are?

Werner


-
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
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] what version of wxpython to use???

2007-02-22 Thread Werner F. Bruhin
Hi Jeff,

Jeff Peery wrote:
> hello, I am having some difficulty. I just upgraded to matplotlib 0.9, 
> wxpython 2.7.2, and python 2.5. I have a wx application that uses 
> matplotlib wxagg backend and wxpython for the GUI, it was working 
> wonderfully unitl I upgraded now it crashes all the time and I can't 
> even debug it because python IDLE freezes up. should these versions 
> all be working together ok? or should I use an earlier version of 
> wxpython? thanks.
Matplotlib 0.9 is still build against wxPython 2.6 and it is using the 
Unicode build of it.

But I am surprised that you see crashes.  I did a little bit of testing 
with wxPython 2.8, Python 2.5 and matplotlib 0.9 using the examples for 
matplotlib and did not see hard crashes (see the thread on the 14th).

Do you get any log file, are you seeing the crash when your app is py2exe'd?

Aren't there some conflicts between IDLE and wxPython?

Werner

-
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
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplotlib and py2exe

2007-03-31 Thread Werner F. Bruhin

Hi Archana,

Archana Ganesan wrote:

Hi all,

I have a python application that uses matplotlib. I want to compile it 
into an executable. I tried using py2exe but it returned some error 
w.rt matplotlib. Cpuld anyone please help me with this? Is there some 
other way to get it done?

I am using matplotlib (currently 0.90) with wxPython and py2exe
(0.6.6).  Attached are some sample files.

I am on:
# Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)]
# wxPython 2.8.1.1, Boa Constructor 0.5.2

And as I am still using wxPython Ansi I renamed

matplotlib/backends/_wxagg.pyd

to

matplotlib/backends/_wxagg not used.pyd

Hope this helps
Werner

# -*- coding: iso-8859-1 -*-#
from distutils.core import setup
import os
from os.path import join
import shutil

import glob
import py2exe
from py2exe.build_exe import py2exe
import sys

import matplotlib
mpdir, mpfiles = matplotlib.get_py2exe_datafiles()

# cleanup dist and build directory first (for new py2exe version)
if os.path.exists("dist/prog"):
shutil.rmtree("dist/prog")

if os.path.exists("dist/lib"):
shutil.rmtree("dist/lib")

if os.path.exists("build"):
shutil.rmtree("build")



#
# A program using wxPython

# The manifest will be inserted as resource into the .exe.  This
# gives the controls the Windows XP appearance (if run on XP ;-)
#
manifest_template = '''



%(prog)s





  

  


   
  

'''

RT_MANIFEST = 32
#

# options for py2exe
options = {"py2exe": {"compressed": 1,
  "optimize": 2,
  "packages": ["encodings",
##   "kinterbasdb",
   "pytz.zoneinfo.UTC", "matplotlib.numerix",
##   "email",
##   "numpy"
##   "PIL",
   ],
  "excludes": ["MySQLdb", "Tkconstants", "Tkinter", "tcl",
   "orm.adapters.pgsql", "orm.adapters.mysql"
  ],
  "dll_excludes": ["tcl84.dll", "tk84.dll", 
"wxmsw26uh_vc.dll"]
  }
  }
zipfile = r"lib\library.zip"

class MetaBase:
def __init__(self, **kw):
self.__dict__.update(kw)
self.version = '1.0'
self.author = "yourname"
self.author_email = "[EMAIL PROTECTED]"
self.company_name = ""
self.copyright = "2003 - 2007 by whoever"
self.url = "http://www.whatever.com/";
self.download_url = "http://www.whatever.com/en/";
self.trademark = ""
self.comments = "a comment on the prog"
self.name = "the prog name"
self.description = "a desc on the prog"

wx_emb = MetaBase(
script = "embedding_in_wx4.py",
other_resources = [(RT_MANIFEST, 1, manifest_template % 
dict(prog="your prog name"))],
##icon_resources = [(1, r"images/some.ico")],
dest_base = r"prog\wx_embed")

setup(
  classifiers = ["Copyright:: your name",
 "Development Status :: 5 Stable",
 "Intended Audience :: End User",
 "License :: Shareware",
 "Operating System :: Microsoft :: Windows 2000",
 "Operating System :: Microsoft :: Windows XP",
 "Operating System :: Microsoft :: Windows 9x",
 "Programming Language :: Python, wxPython",
 "Topic :: Home Use"
 "Natural Language :: German",
 "Natural Language :: French",
 "Natural Language :: English"],
  windows = [wx_emb],
  #console = [twcb],
  options = options,
  zipfile = zipfile,
  data_files = [("lib\\matplotlibdata", mpfiles),
##matplotlib.get_py2exe_datafiles(), # if you don't use the 
lib option
("prog\\amaradata", amaradata),
("prog\\amaradata\\Schemata", amaraschemata),
("prog\\", python4dll)
]
)
#!/usr/bin/env python
"""
An example of how to use wx or wxagg in an application with a custom
toolbar
"""

from matplotlib.numerix import arange, sin, 

Re: [Matplotlib-users] matplotlib and py2exe

2007-04-01 Thread Werner F. Bruhin
Hi Archana,

Sometimes py2exe can't figure out what needs to be included.  In these 
cases one creates entries in the packages section to force the inclusion 
of one or multiple packages.

Archana Ganesan wrote:
> Hi all,
> ...
>
> options = {"py2exe": {"compressed": 1,
>  "optimize": 2,
>  "packages": ["encodings",
> ##   "kinterbasdb",
>   "pytz.zoneinfo.UTC",
>   #" matplotlib.numerix",
>   

You need to activate/un-comment the matplotlib.numerix line.  Also note 
that if you only include UTC and you use the timezone stuff in matplot 
then a user NOT using UTC, i.e. another timezone will have a problem, it 
is therefore better to just include all of pytz.

Werner

-
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
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplotlib and py2exe

2007-04-02 Thread Werner F. Bruhin
Hi Archana,

Archana Ganesan wrote:
> Hi,
>
> I tried following the instructions at the py2exe site and I have also 
> uncommeneted and made it include the matplotlib.numerix package. Still 
> it doesnt seem to work. Is there any other way of compiling it into an 
> executable?
Did you try to compile the sample I enclosed the other day?  Did that 
work?  If not what error are you getting.

Are you using numpy or ?

Provide a small sample (with no dependencies if possible) which does not 
work for you with the corresponding setup.py.

Werner

-
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
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplotlib and py2exe

2007-04-03 Thread Werner F. Bruhin
Hi Giorgio,

Giorgio Luciano wrote:
> Hello Werner,
> here is the file I try to compile.
> It gave an error of missing DLL when i try to launch :(
> no Idea why, since with you example everything works
> (I'm using maplotlib 0.87.7)
I assume the DLL not found is "wxmsw26uh_vc.dll" at least I believe that 
87.7 is already compiled against wxPython 2.6 Unicode (hopefully this 
dependency will go away with some future release of matplotlib), so you 
need to either use the Unicode version of wxPython 2.6 or do the 
following as mentioned earlier in this thread.

matplotlib/backends/_wxagg.pyd

to

matplotlib/backends/_wxagg not used.pyd

If it is another .dll missing it would help if you let us know the name 
and the exact exception.

Werner

-
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
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplotlib and py2exe

2007-04-04 Thread Werner F. Bruhin
Hi Daniel,

Daniel Stalder wrote:
> Hello
>
> I saw your thread and I have a related problem.
> I use matplotlib (0.90.0.win32-py2.5) with wxPython
> (2.8-win32-unicode-2.8.3.0-py25).
> I use matplotlib with WXAgg and got the following error msg:
> "This application has failed to start because wxmsw26uh_vc.dll was not
> found. Re-installing the application may fix this problem."
>   
Re-install will not help.  The problem is that matplotlib is 
compiled/linked against wxPython 2.6 Unicode.

A work around Andrea Gavana found is to do the following rename, before 
you py2exe the app.

matplotlib/backends/_wxagg.pyd

to

matplotlib/backends/_wxagg not used.pyd


Werner

-
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
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplotlib and py2exe

2007-04-04 Thread Werner F. Bruhin
Hi Giorgio,

Giorgio Luciano wrote:
> Hello Werner,
> and thank for the reply I've tried to recompile everything. The file 
> you sent in the mailing list give me the problem of wxmsw26uh_vc.dll 
> (and also dll missing while compiling)
For the wxmsw26uh_vc.dll you need to rename the .pyd file as mentioned 
in the response to Daniel before you py2exe it.

The error output you get when running py2exe is normal, it just tells 
you that there are files not included by py2exe.  You need to decide if 
you need them, if you have the right to distribute them etc and then 
either include them with your installer or add them to the package 
include option for py2exe.
> but then it runs
> when I try to compile my file (nipals) it doesnt' start and give me as 
> error
Sorry, I don't understand why you get the error about backends, but I 
can't run your nipals.py as it contains/uses modules I don't have.

I'll see if I can do a setup.py for a simple matplotlib file using pylab.

Werner

-
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
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplotlib and py2exe

2007-04-04 Thread Werner F. Bruhin

Hi Giorgio,

Had a quick look at pylab based scripts and got an error on 
backend_tkagg when py2exe it.  It looks like one needs to force the 
backend to be included, I used tkagg but you would have to replace that 
with wxagg for your script.


Attached is a setup.py and from the examples the file simple_plot.py.

Werner
# -*- coding: iso-8859-1 -*-#
from distutils.core import setup
import os
from os.path import join
import shutil

import glob
import py2exe
from py2exe.build_exe import py2exe
import sys

import matplotlib
mpdir, mpfiles = matplotlib.get_py2exe_datafiles()

# cleanup dist and build directory first (for new py2exe version)
if os.path.exists("dist/prog"):
shutil.rmtree("dist/prog")

if os.path.exists("dist/lib"):
shutil.rmtree("dist/lib")

if os.path.exists("build"):
shutil.rmtree("build")



#
# A program using wxPython

# The manifest will be inserted as resource into the .exe.  This
# gives the controls the Windows XP appearance (if run on XP ;-)
#
manifest_template = '''



%(prog)s





  

  


   
  

'''

RT_MANIFEST = 32
#

# options for py2exe
options = {"py2exe": {"compressed": 1,
  "optimize": 2,
  "packages": ["encodings",
   "pytz.zoneinfo.UTC", "matplotlib.numerix", 
"matplotlib.backends.backend_tkagg"
   ],
  "excludes": ["MySQLdb", ],
  "dll_excludes": ["wxmsw26uh_vc.dll"]
  }
  }
zipfile = r"lib\library.zip"

class MetaBase:
def __init__(self, **kw):
self.__dict__.update(kw)
self.version = '1.0'
self.author = "yourname"
self.author_email = "[EMAIL PROTECTED]"
self.company_name = ""
self.copyright = "2003 - 2007 by whoever"
self.url = "http://www.whatever.com/";
self.download_url = "http://www.whatever.com/en/";
self.trademark = ""
self.comments = "a comment on the prog"
self.name = "the prog name"
self.description = "a desc on the prog"

wx_emb = MetaBase(
script = "simple_plot.py",
other_resources = [(RT_MANIFEST, 1, manifest_template % 
dict(prog="your prog name"))],
##icon_resources = [(1, r"images/some.ico")],
dest_base = r"prog\simple_plot")

setup(
  classifiers = ["Copyright:: your name",
 "Development Status :: 5 Stable",
 "Intended Audience :: End User",
 "License :: Shareware",
 "Operating System :: Microsoft :: Windows 2000",
 "Operating System :: Microsoft :: Windows XP",
 "Operating System :: Microsoft :: Windows 9x",
 "Programming Language :: Python, wxPython",
 "Topic :: Home Use"
 "Natural Language :: German",
 "Natural Language :: French",
 "Natural Language :: English"],
  windows = [wx_emb],
  options = options,
  zipfile = zipfile,
  data_files = [("lib\\matplotlibdata", mpfiles),
##matplotlib.get_py2exe_datafiles(), # if you don't use the 
lib option
]
)#!/usr/bin/env python
"""
Example: simple line plot.
Show how to make and save a simple line plot with labels, title and grid
"""
from pylab import *

t = arange(0.0, 1.0+0.01, 0.01)
s = cos(2*2*pi*t)
plot(t, s)

xlabel('time (s)')
ylabel('voltage (mV)')
title('About as simple as it gets, folks')
grid(True)

#savefig('simple_plot.png')
savefig('simple_plot')

show()
-
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
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplotlib and py2exe

2007-04-05 Thread Werner F. Bruhin
Hi Archana,

Archana Ganesan wrote:
> ...
> trial.py is as follows.
>
> from pylab import *
>
> x = xrange(10)
> plot(x)
> savefig("trial.png")
>
The setup.py you are using will not work, it is meant for a matplotlib 
embedded in wx, and even for that some lines are commented out.

Can you try the setup.py I sent yesterday with which I included 
simple_plot.py, which is a script using pylab as you do in your trial.py.

Werner

-
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
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] .notdef

2007-04-07 Thread Werner F. Bruhin
Johann,

Jouni K. Seppänen wrote:
> "Werner F. Bruhin" <[EMAIL PROTECTED]> writes:
>
>   
>>>> Actually, I have other problems : I cannot save in many formats. The
>>>> bmp is deemed usueless by gimp,
>>>> 
>>> I didn't even know you can save in bmp format. Does png format work
>>> better?
>>>   
>>>   
>> .png works for me and GIMP does not complain when opening the
>> generated png file.
>> 
>
> Could you file a bug about the bmp problem at 
>
> http://sf.net/tracker/?group_id=80706&atid=560720
>
> so it doesn't get overlooked? Please include a short example script
> and the error message from Gimp. Thanks for reporting the problem!
>   
I think you had the problem with the bmp file.  Could you do the bug report?

Werner



-
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
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplotlib and py2exe

2007-04-09 Thread Werner F. Bruhin
Hi Emmanuel,

Maybe your problem has to do with your "enthought" build of wxPython.  I
use standard builds from wxPython site.

Emmanuel wrote:
> when putting the full path of wxmsw26u_vc_enthought.dll  in setup.py 
> like this
>
> data_files = [("lib\\matplotlibdata", mpfiles),
> matplotlib.get_py2exe_datafiles(), # if you don't 
> use the lib option
You get two copies of matplotlibdata as you kept both of the two above
lines active.  You need to use the first one of you use the py2exe
option to create a library.zip which I put into a sub-folder called
'lib' in the sample setup.py file.
> "C:\\Python24\\Lib\\site-packages\\wx-2.6.1.0-py2.4-win32.egg\\wx\\wxmsw26u_vc_enthought.dll",
> ##"wxmsw26u_vc_enthought.dll",
> ("prog\\", python4dll)
>]
>
You are also using an 'egg'.  I seem to recall that py2exe does not yet
really support that, but you might want to check on the py2exe list
(e.g. on the gmane mirror of it at
http://dir.gmane.org/gmane.comp.python.py2exe

Werner


-
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
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Yet another matplotlib py2exe problem

2007-04-12 Thread Werner F. Bruhin
Grant,

Grant Edwards wrote:
> OK, I'm on my third day of fighting with matplotlib.  I'm
> finally able to get py2exe to produce a "dist" directory, but
> it _still_ doesn't work:
>
>   Traceback (most recent call last):
> File "surfacedit.py", line 3, in ?
> File "wxmpl.pyc", line 23, in ?
> File "matplotlib\__init__.pyc", line 715, in ?
> File "matplotlib\__init__.pyc", line 273, in wrapper
> File "matplotlib\__init__.pyc", line 360, in _get_data_path
>   RuntimeError: Could not find the matplotlib data files
>
> Here's the setup file I'm using:
>
>
> from distutils.core import setup
> import py2exe
> import matplotlib
>
> setup(windows=[{"script":"surfacedit.py"}],
>   data_files=[('',['../win32/gnuplot/bin/wgnuplot.exe',
>'../win32/gnuplot/bin/pgnuplot.exe',
>'../win32/gnuplot/bin/wgnuplot_pipes.exe']
>   ) + matplotlib.get_py2exe_datafiles()],
>   
the above line does not look correct.  I.e. the '+' in there, what is it
for?

I have a folder structure of
dist/lib
dist/prog

so this one works for me
  ("lib\\matplotlibdata", mpfiles), # use this line if use zipfile option

if one does not use the py2exe zipfile option, which I use, then this
should work
  matplotlib.get_py2exe_datafiles(), # or this one if you don't use the
zipfile option

If one uses the zipfile option then all of the matplotlib stuff is under:
dist/lib
and it expects to have the data stuff in
dist/lib

otherwise it wants it in
dist

>   options={'py2exe': {'packages': ['matplotlib.numerix','pytz'],
>   'dll_excludes': ['tcl84.dll', 'tk84.dll', 
> 'wxmsw26uh_vc.dll'],
>   'excludes': ["Tkconstants", "Tkinter", "tcl", 
> '_gtkagg', '_tkagg']}}
>   )
>
> Is there any current, correct, documentation on how to bundle a
> matplotlib app?  
>
>   

I don't know, but I think the setup.py I posted to this list for
"embedding_in_wx4.py" is pretty accurate and at least for me it does
build a matplotlib app.

Werner


-
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] FigureCanvasWx setting font properties

2007-05-03 Thread Werner F. Bruhin
Hi Uwe,

Uwe Schmitt wrote:
> Hi,
>
> I'm using
>
>  from matplotlib.backends.backend_wx import FigureCanvasWx
>
> for plotting data. It works fine, but the font used on
> Windows XP is not really pretty. I would like to use another
> font family and another size.

I just recently discovered this for a Vista legend problem I had (they 
were to big).

from matplotlib.font_manager import FontProperties
self.figure.legend((statsLinesP + statsLinesC), (statsTextsP + 
statsTextsC),
loc=self.legendPos, prop=FontProperties(size='smaller'))

Werner

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


Re: [Matplotlib-users] DLL not found when importing pylab on Windows

2007-05-10 Thread Werner F. Bruhin
Hi Paul,

Paul Ray wrote:
> Hi,
>
> A colleague of mine uses Python on Windows.  When he upgraded to  
> matplotlib 0.90 (from 0.82, I think) he started getting an import  
> error when importing pylab.  We tried many combinations and the only  
> thing that fixed it was downgrading back to 0.82.
>
> We tried:
> python2.4 and python2.5
> numpy 1.0.1 and 1.0.2
> matplotlib 0.90 and 0.87.7
>   
What backend are you using?

If you use wxPython then as of 0.87.?  something you need to either use 
wxPython 2.6 Unicode or rename the following file:

matplot\backends\_wxagg.pyd

to
matplot\backends\_wxagg DO NOT USE.pyd (or something similar).

The 0.87 version was compiled against wxPython 2.6 to take accelarate some 
functions, by renaming the above file you basically deactive this accelaration 
code.

I believe the next version of matplotlib will get rid of this dependency.


Werner

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


Re: [Matplotlib-users] DLL not found when importing pylab on Windows

2007-05-10 Thread Werner F. Bruhin
Hi Paul,

Paul Ray wrote:
>
> On May 10, 2007, at 10:34 AM, Werner F. Bruhin wrote:
>
>> What backend are you using?
>>
>> If you use wxPython then as of 0.87.?  something you need to either 
>> use wxPython 2.6 Unicode or rename the following file:
>
> I'm not 100% sure.  We certainly didn't intentionally use wxPython, 
> since I don't even know what it is.
It is a Python wrapping of wxWidgets, much nicer then Tk in my view.
>   The only packages we installed were python, numpy, and matplotlib.  
> I think his backend is TkAgg, but I can't check since it was on my 
> colleagues computer and he is on travel today.  (All the rest of us us 
> python/numpy/matplotlib on Macs or Linux and everything is fine with 
> 0.90)
If you or he uses TkAgg then I have no idea what might cause the problem.

Should you have a small matplotlib script which shows the problem I'll 
give it a try on my setup (XP or Vista with Python 2.5 and numpy.
>
> I know there are a bunch of .pyd files in his matplotlib directory.  
> Are those Windows DLL versions of packages?  As far as I could tell 
> the relevant one "_ns_transforms.pyd" is there, so I'm not sure why it 
> is having trouble finding it (though I'm working from memory here).
Someone more technical has to explain that, but I believe you right in 
saying that the .pyd files are a kind of a DLL on Windows.

Werner

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


Re: [Matplotlib-users] DLL not found when importing pylab on Windows

2007-05-10 Thread Werner F. Bruhin
Paul,

Paul Ray wrote:
>
> On May 10, 2007, at 11:05 AM, Werner F. Bruhin wrote:
>
>> Should you have a small matplotlib script which shows the problem 
>> I'll give it a try on my setup (XP or Vista with Python 2.5 and numpy.
>
> No need for a script.  "import pylab" produces the error.
No problem here with this.

Just tried the example \matplotlib\examples\animation_blit_tk.py and 
that runs fine too (except it does not shut down nicely if has not done 
it's 1000 iterations:)).
> If you are using Windows XP, Python 2.5, numpy 1.0.2, and matplotlib 
> 0.90, then you have the same setup that is causing us the error.  What 
> other packages do you have installed.  My guess is that there is some 
> dependency we are not satisfying?
This was on Vista, Python 2.5, matplotlib 0.90, numpy 1.0.1.  (can't try 
this config on XP, still have 0.82 installed on there at the moment)

If you look at _transforms.py  _ns_transforms is imported for numpy.  
So, maybe your version of numpy is too far ahead?

>
> Thanks for your help,
You are welcome.

Werner

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


Re: [Matplotlib-users] matplotlib and py2exe

2007-05-28 Thread Werner F. Bruhin

Hi Robert,

If your app is wxPython based then I would use the attached as a test 
case and not the simple_plot one.


Then if you don't use wxPython Unicode 2.6.x then you need to follow 
Andrea's work around.


matplotlib/backends/_wxagg.pyd

to

matplotlib/backends/_wxagg not used.pyd


Hope this helps
Werner
#!/usr/bin/env python
"""
An example of how to use wx or wxagg in an application with a custom
toolbar
"""

from matplotlib.numerix import arange, sin, pi

import matplotlib

# uncomment the following to use wx rather than wxagg
#matplotlib.use('WX')
#from matplotlib.backends.backend_wx import FigureCanvasWx as FigureCanvas

# comment out the following to use wx rather than wxagg
matplotlib.use('WXAgg')
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas
from matplotlib.backends.backend_wxagg import NavigationToolbar2WxAgg

from matplotlib.backends.backend_wx import _load_bitmap
from matplotlib.figure import Figure
from matplotlib.numerix.mlab import rand

import wx

class MyNavigationToolbar(NavigationToolbar2WxAgg):
"""
Extend the default wx toolbar with your own event handlers
"""
ON_CUSTOM = wx.NewId()
def __init__(self, canvas, cankill):
NavigationToolbar2WxAgg.__init__(self, canvas)

# for simplicity I'm going to reuse a bitmap from wx, you'll
# probably want to add your own.
self.AddSimpleTool(self.ON_CUSTOM, _load_bitmap('stock_left.xpm'),
   'Click me', 'Activate custom contol')
self.Bind(wx.EVT_TOOL, self._on_custom, id=self.ON_CUSTOM)

def _on_custom(self, evt):
# add some text to the axes in a random location in axes (0,1)
# coords) with a random color

# get the axes
ax = self.canvas.figure.axes[0]

# generate a random location can color
x,y = tuple(rand(2))
rgb = tuple(rand(3))

# add the text and draw
ax.text(x, y, 'You clicked me',
transform=ax.transAxes,
color=rgb)
self.canvas.draw()
evt.Skip()


class CanvasFrame(wx.Frame):

def __init__(self):
wx.Frame.__init__(self,None,-1,
 'CanvasFrame',size=(550,350))

self.SetBackgroundColour(wx.NamedColor("WHITE"))

self.figure = Figure(figsize=(5,4), dpi=100)
self.axes = self.figure.add_subplot(111)
t = arange(0.0,3.0,0.01)
s = sin(2*pi*t)

self.axes.plot(t,s)

self.canvas = FigureCanvas(self, -1, self.figure)

self.sizer = wx.BoxSizer(wx.VERTICAL)
self.sizer.Add(self.canvas, 1, wx.TOP | wx.LEFT | wx.EXPAND)
# Capture the paint message
self.Bind(wx.EVT_PAINT, self.OnPaint)

self.toolbar = MyNavigationToolbar(self.canvas, True)
self.toolbar.Realize()
if wx.Platform == '__WXMAC__':
# Mac platform (OSX 10.3, MacPython) does not seem to cope with
# having a toolbar in a sizer. This work-around gets the buttons
# back, but at the expense of having the toolbar at the top
self.SetToolBar(self.toolbar)
else:
# On Windows platform, default window size is incorrect, so set
# toolbar width to figure width.
tw, th = self.toolbar.GetSizeTuple()
fw, fh = self.canvas.GetSizeTuple()
# By adding toolbar in sizer, we are able to put it at the bottom
# of the frame - so appearance is closer to GTK version.
# As noted above, doesn't work for Mac.
self.toolbar.SetSize(wx.Size(fw, th))
self.sizer.Add(self.toolbar, 0, wx.LEFT | wx.EXPAND)

# update the axes menu on the toolbar
self.toolbar.update()
self.SetSizer(self.sizer)
self.Fit()


def OnPaint(self, event):
self.canvas.draw()
event.Skip()

class App(wx.App):

def OnInit(self):
'Create the main window and insert the custom frame'
frame = CanvasFrame()
frame.Show(True)

return True

app = App(0)
app.MainLoop()
# -*- coding: iso-8859-1 -*-#
from distutils.core import setup
import os
from os.path import join
import shutil

import glob
import py2exe
from py2exe.build_exe import py2exe
import sys

import matplotlib
mpdir, mpfiles = matplotlib.get_py2exe_datafiles()

# should not be needed as o py2exe 0.6 no
# cleanup dist and build directory first (for new py2exe version)
if os.path.exists("dist/prog"):
shutil.rmtree("dist/prog")

if os.path.exists("dist/lib"):
shutil.rmtree("dist/lib")

if os.path.exists("build"):
shutil.rmtree("build")



#
# A program using wxPython

# The mani

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

2007-06-04 Thread Werner F. Bruhin
John Hunter wrote:
> matplotlib 0.90.1 is out and available for download from the sourceforge site.
>   
Just installed it.  Works very nicely with the exception of some font 
issue.

I am getting this:
Could not match Bitstream Vera Serif, New Century Schoolbook, Century 
Schoolbook L, Utopia, ITC Bookman, Bookman, Nimbus Roman No9 L, Times 
New Roman, Times, Palatino, Charter, serif, normal, normal.  Returning 
C:\Python25\lib\site-packages\matplotlib\mpl-data\fonts\ttf\Vera.ttf

The only font commands I use are FontProperties(size='smaller') or 
FontProperties(size=10) as far as I can see.

What do I need to do to get read of this?

I don't just want to change the verbose option.

Any hints very appreciated.
Werner

P.S. John, sorry for the first mail sent to you instead of the list.
> The 0.90 release is the last release in which we will continue to use
> the numerix layer internally and build extensions for Numeric,
> numarray and numpy.  Goingin forward, we will continue to provide the
> numerix compatibility layer for external scripts, and recent versions
> of Numeric and numarray should continue to work when passed into mpl,
> but we will be compiling extensions against numpy only and importing
> it directly internally.
>
> Thanks Charlie Moad for handling the release and binary builds, and to
> all the mpl developers who made contributions.  See
> http://matploltib.sf.net/whats_new.html for a summary of new features,
> and the CHANGELOG included below for details.  As always, be sure to
> consult http://matplotlib.sf.net/API_CHANGES to read about any changes
> to the API
>
> http://cheeseshop.python.org/pypi/matplotlib/
>
> http://sourceforge.net/project/showfiles.php?group_id=80706&package_id=82474
>
> ===
> 2007-06-02 Released 0.90.1 at revision 3352
>
> 2007-06-02 Display only meaningful labels when calling legend()
>   without args. - NN
>
> 2007-06-02 Have errorbar follow the color cycle even if line is not plotted.
>   Suppress plotting of errorbar caps for capsize=0. - NN
>
> 2007-06-02 Set markers to same alpha value as line. - NN
>
> 2007-06-02 Fix mathtext position in svg backend. - NN
>
> 2007-06-01 Deprecate Numeric and numarray for use as numerix. Props to
>   Travis -- job well done. - ADS
>
> 2007-05-18 Added LaTeX unicode support. Enable with the
>   'text.latex.unicode' rcParam. This requires the ucs and
>   inputenc LaTeX packages. - ADS
>
> 2007-04-23 Fixed some problems with polar -- added general polygon
>   clipping to clip the lines a nd grids to the polar axes.
>   Added support for set_rmax to easily change the maximum
>   radial grid.  Added support for polar legend - JDH
>
> 2007-04-16 Added Figure.autofmt_xdate to handle adjusting the bottom
>   and rotating the tick labels for date plots when the ticks
>   often overlap - JDH
>
> 2007-04-09 Beginnings of usetex support for pdf backend. -JKS
>
> 2007-04-07 Fixed legend/LineCollection bug. Added label support
>   to collections. - EF
>
> 2007-04-06 Removed deprecated support for a float value as a gray-scale;
>   now it must be a string, like '0.5'.  Added alpha kwarg to
>   ColorConverter.to_rgba_list. - EF
>
> 2007-04-06 Fixed rotation of ellipses in pdf backend
>   (sf bug #1690559) -JKS
>
> 2007-04-04 More matshow tweaks; documentation updates; new method
>   set_bounds() for formatters and locators. - EF
>
> 2007-04-02 Fixed problem with imshow and matshow of integer arrays;
>   fixed problems with changes to color autoscaling. - EF
>
> 2007-04-01 Made image color autoscaling work correctly with
>   a tracking colorbar; norm.autoscale now scales
>   unconditionally, while norm.autoscale_None changes
>   only None-valued vmin, vmax. - EF
>
> 2007-03-31 Added a qt-based subplot-adjustment dialog - DSD
>
> 2007-03-30 Fixed a bug in backend_qt4, reported on mpl-dev - DSD
>
> 2007-03-26 Removed colorbar_classic from figure.py; fixed bug in
>   Figure.clf() in which _axobservers was not getting
>   cleared.  Modernization and cleanups. - EF
>
> 2007-03-26 Refactored some of the units support -- units now live in
>   the respective x and y Axis instances.  See also
>   API_CHANGES for some alterations to the conversion
>   interface.  JDH
>
> 2007-03-25 Fix masked array handling in quiver.py for numpy. (Numeric
>   and numarray support for masked arrays is broken in other
>   ways when using quiver. I didn't pursue that.) - ADS
>
> 200

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

2007-06-05 Thread Werner F. Bruhin

John,

John Hunter wrote:

On 6/4/07, Werner F. Bruhin <[EMAIL PROTECTED]> wrote:

John Hunter wrote:
> matplotlib 0.90.1 is out and available for download from the 
sourceforge site.

>
Just installed it.  Works very nicely with the exception of some font
issue.

I am getting this:
Could not match Bitstream Vera Serif, New Century Schoolbook, Century
Schoolbook L, Utopia, ITC Bookman, Bookman, Nimbus Roman No9 L, Times
New Roman, Times, Palatino, Charter, serif, normal, normal.  Returning
C:\Python25\lib\site-packages\matplotlib\mpl-data\fonts\ttf\Vera.ttf


make sure you are picking up the most recent matplotlibrc.
I don't have a custom rc file, i.e. this is with the 0.90.1 installed 
matplotlibrc.

  We changed
the font ordering some time ago.  Then run with --verbose-helpful and
post the output, maybe --verbose-debug, and we will see if we can
figure out what is going on.  I haven't run under windows for some
time.

I attached the verbose-debug output.

Maybe to do with the fontcache?  Will try this in a moment and let you 
know if it corrected the issue.


Werner






loaded rc file C:\Python25\lib\site-packages\matplotlib\mpl-data\matplotlibrc
matplotlib version 0.90.1
verbose.level debug
interactive is False
units is True
platform is win32
loaded modules: ['email.MIMEAudio', 'nbwinedetails', 'ctypes.os', 'gc', 
'matplotlib.tempfile', 'PIL.traceback', 'distutils.sysconfig', 
'Ft.Xml.Domlette', 'PIL.PngImagePlugin', 'kinterbasdb.services', 
'Ft.Xml.Lib.Print', 'Ft.Lib.urllib', 'panelbottle', 'base64', 
'Ft.Xml.XPath.Conversions', 'amara.saxtools', 'email.MIMENonMultipart', 
'PIL.warnings', 'wx.lib.masked.numctrl', 'PIL.BmpImagePlugin', 'random', 
'Ft.Lib.__future__', 'encodings.utf_8', 'amara.pyxml_standins', 
'email.quoprimime', 'Ft.Xml.re', 'kinterbasdb.k_exceptions', 'myimages', 
'wx.lib.cPickle', 'wx.wx', 'Ft.Xml.Xslt.os', 'cmd', 
'mx.DateTime.mxDateTime.time', 'orm.sys', 'orm.string', 'dis', 
'Ft.Xml.MarkupWriter', 'PIL.re', 'wx.lib.math', 'wx.__version__', 
'Ft.Xml.XPath.Util', 'nbpurchases', 'Ft.Lib.zipimport', 
'Ft.Xml.Xslt.XmlWriter', 'orm.inetaddr', 'PIL.string', 'matplotlib.sys', 
'ntpath', 'dialogcuvee', 'new', 'Ft.Xml.XPath.ParsedExpr', 'wx.lib.cStringIO', 
'Ft.Xml.XPath.warnings', 'Ft.Xml.XPath.ParsedRelativeLocationPath', 
'PIL.Image', '_ctypes', 'amara.warnings', 'codecs', 'email.Header', 
'kinterbasdb.mx', 'wx._gizmos', 'email.socket', 'StringIO', 
'orm.adapters.firebird.types', 'Ft.Xml.XPath.MathFunctions', 'weakref', 
'amara.keyword', 'win32pipe', 'Ft.Xml.Lib.os', 'distutils.sys', 
'orm.__builtin__', 'paneltsummary', 'PIL.operator', 
'Ft.Xml.Xslt.OutputParameters', '_sre', 'PIL.ImagePalette', 'email.FeedParser', 
'matplotlib.re', 'orm.adapters.firebird.string', 'email.charset', 
'ctypes._ctypes', '_heapq', 'Ft', 'textctrldate', 'Ft.Ft', 'binascii', 
'wx.lib.sys', 'Ft.Xml.XPath._comparisons', 'Ft.Xml.Xslt.cmd', 
'email.MIMEMessage', 'encodings.latin_1', 'email.sys', 'tokenize', 
'Ft.Xml.Xslt.XPatterns', 'md5', 'cPickle', 'wx.lib.weakref', 
'Ft.Xml.XPath.ParsedAbbreviatedAbsoluteLocationPath', 'Ft.Lib.string', 
'Ft.Xml.Lib.HtmlPrettyPrinter', 'socket', 'orm.adapters.firebird.math', 
'wx.lib.masked.types', 'dateutil.tz', 'encodings.aliases', 'exceptions', 
'sre_parse', 'amara.time', 'mx', 'xml.sax.types', 'orm.socket', 
'Ft.Xml.XPath.math', 'twcbF', 'Ft.Lib.Gettext', 'encodings.cp1252', 'wx.lib', 
'wx.lib.masked.ctrl', 'amara.dateutil', 'email.message', 'string', 
'Ft.Xml.Lib', 'email.MIMEBase', 'mx.DateTime.mxDateTime', 'strop', 
'Ft.Lib.pkgutil', 'Ft.Lib.mimetools', 'wx._controls_', 'wx.os', 
'amara.binderyxpath', 'dateutil.relativedelta', 'wx.lib.buttons

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

2007-06-05 Thread Werner F. Bruhin

John,

John Hunter wrote:

On 6/4/07, Werner F. Bruhin <[EMAIL PROTECTED]> wrote:

John Hunter wrote:
> matplotlib 0.90.1 is out and available for download from the 
sourceforge site.

>
Just installed it.  Works very nicely with the exception of some font
issue.

I am getting this:
Could not match Bitstream Vera Serif, New Century Schoolbook, Century
Schoolbook L, Utopia, ITC Bookman, Bookman, Nimbus Roman No9 L, Times
New Roman, Times, Palatino, Charter, serif, normal, normal.  Returning
C:\Python25\lib\site-packages\matplotlib\mpl-data\fonts\ttf\Vera.ttf


make sure you are picking up the most recent matplotlibrc.  We changed
the font ordering some time ago.  Then run with --verbose-helpful and
post the output, maybe --verbose-debug, and we will see if we can
figure out what is going on.  I haven't run under windows for some
time.

Works the first time after I removed the cache file.  Looking at the 
file it might have something to do with Unicode, i.e. one of the two "/" 
is encoded as 'u0005C', see attached file.


Werner

(dp1
S'cmsy10'
p2
(dp3
S'normal'
p4
(dp5
g4
(dp6
I400
(dp7
g4
(dp8
S'scalable'
p9
S'C:\\Python25\\lib\\site-packages\\matplotlib\\mpl-data\\fonts\\ttf\\cmsy10.ttf'
p10
ssS'Baveuse'
p11
(dp12
g4
(dp13
g4
(dp14
I400
(dp15
g4
(dp16
g9
VC:\u005CWindows\u005CFonts\u005CBAVEUSE.TTF
p17
ssS'Mangal'
p18
(dp19
g4
(dp20
g4
(dp21
I400
(dp22
g4
(dp23
g9
VC:\u005CWindows\u005CFonts\u005Cmangal.ttf
p24
ssS'Arial'
p25
(dp26
S'italic'
p27
(dp28
g4
(dp29
I400
(dp30
g4
(dp31
g9
VC:\u005CWindows\u005CFonts\u005Cariali.ttf
p32
sssI700
(dp33
g4
(dp34
g9
VC:\u005CWindows\u005CFonts\u005Carialbi.ttf
p35
sg4
(dp36
g4
(dp37
I400
(dp38
g4
(dp39
g9
VC:\u005CWindows\u005CFonts\u005Carial.ttf
p40
sssI700
(dp41
g4
(dp42
g9
VC:\u005CWindows\u005CFonts\u005Carialbd.ttf
p43
ssS'Neuropol'
p44
(dp45
g4
(dp46
g4
(dp47
I400
(dp48
g4
(dp49
g9
VC:\u005CWindows\u005CFonts\u005CNEUROPOL.TTF
p50
ssS'Catriel'
p51
(dp52
g27
(dp53
g4
(dp54
I400
(dp55
g4
(dp56
g9
VC:\u005CWindows\u005CFonts\u005Ccatriel italic.ttf
p57
sssI700
(dp58
g4
(dp59
g9
Vc:\u005Cwindows\u005Cfonts\u005Ccatriel bolditalic.ttf
p60
sg4
(dp61
g4
(dp62
I400
(dp63
g4
(dp64
g9
Vc:\u005Cwindows\u005Cfonts\u005Ccatriel regular.ttf
p65
sssI700
(dp66
g4
(dp67
g9
Vc:\u005Cwindows\u005Cfonts\u005Ccatriel bold.ttf
p68
ssS'Arial Narrow'
p69
(dp70
g27
(dp71
g4
(dp72
I400
(dp73
S'condensed'
p74
(dp75
g9
Vc:\u005Cwindows\u005Cfonts\u005Carialni.ttf
p76
sssI700
(dp77
g74
(dp78
g9
VC:\u005CWindows\u005CFonts\u005CArialNbi.TTF
p79
sg4
(dp80
g4
(dp81
I400
(dp82
g74
(dp83
g9
Vc:\u005Cwindows\u005Cfonts\u005Carialn.ttf
p84
sssI700
(dp85
g74
(dp86
g9
Vc:\u005Cwindows\u005Cfonts\u005Carialnb.ttf
p87
ssS'Blue Highway'
p88
(dp89
g4
(dp90
g4
(dp91
I400
(dp92
g4
(dp93
g9
VC:\u005CWindows\u005CFonts\u005CBLUEHIGH.TTF
p94
sssI700
(dp95
g4
(dp96
g9
Vc:\u005Cwindows\u005Cfonts\u005Cbluebold.ttf
p97
ssS'Gisha'
p98
(dp99
g4
(dp100
g4
(dp101
I400
(dp102
g4
(dp103
g9
Vc:\u005Cwindows\u005Cfonts\u005Cgisha.ttf
p104
sssI700
(dp105
g4
(dp106
g9
Vc:\u005Cwindows\u005Cfonts\u005Cgishabd.ttf
p107
ssS'Eurostile'
p108
(dp109
g4
(dp110
g4
(dp111
I400
(dp112
g4
(dp113
g9
Vc:\u005Cwindows\u005Cfonts\u005Ceurosti.ttf
p114
sssI700
(dp115
g4
(dp116
g9
Vc:\u005Cwindows\u005Cfonts\u005Ceurostib.ttf
p117
ssS'Franklin Gothic Demi Cond'
p118
(dp119
g4
(dp120
g4
(dp121
I600
(dp122
g74
(dp123
g9
Vc:\u005Cwindows\u005Cfonts\u005Cfradmcn.ttf
p124
ssS'Eras Demi ITC'
p125
(dp126
g4
(dp127
g4
(dp128
I600
(dp129
g4
(dp130
g9
Vc:\u005Cwindows\u005Cfonts\u005Cerasdemi.ttf
p131
ssS'MV Boli'
p132
(dp133
g4
(dp134
g4
(dp135
I400
(dp136
g4
(dp137
g9
Vc:\u005Cwindows\u005Cfonts\u005Cmvboli.ttf
p138
ssS'Shruti'
p139
(dp140
g4
(dp141
g4
(dp142
I400
(dp143
g4
(dp144
g9
Vc:\u005Cwindows\u005Cfonts\u005Cshruti.ttf
p145
ssS'Amienne'
p146
(dp147
g4
(dp148
g4
(dp149
I400
(dp150
g4
(dp151
g9
Vc:\u005Cwindows\u005Cfonts\u005Camienne_.ttf
p152
sssI700
(dp153
g4
(dp154
g9
Vc:\u005Cwindows\u005Cfonts\u005Camienneb.ttf
p155
ssS'Times New Roman'
p156
(dp157
g27
(dp158
g4
(dp159
I500
(dp160
g4
(dp161
g9
Vc:\u005Cwindows\u005Cfonts\u005Ctimesi.ttf
p162
sssI700
(dp163
g4
(dp164
g9
Vc:\u005Cwindows\u005Cfonts\u005Ctimesbi.ttf
p165
sg4
(dp166
g4
(dp167
I500
(dp168
g4
(dp169
g9
VC:\u005CWindows\u005CFonts\u005Ctimes.ttf
p170
sssI700
(dp171
g4
(dp172
g9
Vc:\u005Cwindows\u005Cfonts\u005Ctimesbd.ttf
p173
ssS'Earwig Factory'
p174
(dp175
g4
(dp176
g4
(dp177
I400
(dp178
g4
(dp179
g9
VC:\u005CWindows\u005CFonts\u005CEARWIGFA.TTF
p180
ssS'Rockwell Extra Bold'
p181
(dp182
g4
(dp183
g4
(dp184
I700
(dp185
g4
(dp186
g9
Vc:\u005Cwindows\u005Cfonts\u005Crockeb.ttf
p187
ssS'Gautami'
p188
(dp189
g4
(d

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

2007-06-05 Thread Werner F. Bruhin
John Hunter wrote:
> matplotlib 0.90.1 is out and available for download from the sourceforge site.
>   
When trying to package my application with py2exe I get the following error:

Traceback (most recent call last):
  File "setup.py", line 141, in 
mpdir, mpfiles = matplotlib.get_py2exe_datafiles()
  File "C:\Python25\Lib\site-packages\matplotlib\__init__.py", line 369, 
in get_py2exe_datafiles
mplfiles.remove(os.sep.join([get_data_path(), 'Matplotlib.nib']))
ValueError: list.remove(x): x not in list

Werner

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


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

2007-06-05 Thread Werner F. Bruhin
Werner F. Bruhin wrote:
> John Hunter wrote:
>   
>> matplotlib 0.90.1 is out and available for download from the sourceforge 
>> site.
>>   
>> 
> When trying to package my application with py2exe I get the following error:
>
> Traceback (most recent call last):
>   File "setup.py", line 141, in 
> mpdir, mpfiles = matplotlib.get_py2exe_datafiles()
>   File "C:\Python25\Lib\site-packages\matplotlib\__init__.py", line 369, 
> in get_py2exe_datafiles
> mplfiles.remove(os.sep.join([get_data_path(), 'Matplotlib.nib']))
> ValueError: list.remove(x): x not in list
>   
To work around this I just put a try/except in:
try:
# Need to explicitly remove cocoa_agg files or py2exe complains
mplfiles.remove(os.sep.join([get_data_path(), 'Matplotlib.nib']))
except:
pass

But I then get this error:
error: can't copy 
'C:\Python25\lib\site-packages\matplotlib\mpl-data\fonts': doesn't exist 
or not a regular file

I guess I will have to review how I am using the get_py2exe_datafiles stuff.

Werner

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


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

2007-06-05 Thread Werner F. Bruhin
Hi Andrew,

Andrew Straw wrote:
> Dear Werner,
>
> This seems to be an unintended side-effect of reorganizing the mpl 
> data file location that I did prior to this release. (I.e. it's not 
> your code that broke, I think it's mpl.) Unfortunately, since I didn't 
> (and still don't) use py2exe, it will be hard for me to fix this. Can 
> you send a patch that gets py2exe working again?
The work around I did is using glob.glob instead as follows:

# matplotlib data
##mpdir, mpfiles = matplotlib.get_py2exe_datafiles()
mpfiles = glob.glob('C:\Python25\lib\site-packages\matplotlib\mpl-data\*.*')

But I can't confirm yet that this works as I am also trying out 
something else in my InnoSetup script.  Will confirm ASAP and will try 
and look into matplotlib.get_py2exe_datafiles() and see how it could be 
fixed.

Best regards
Werner

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


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

2007-06-07 Thread Werner F. Bruhin
Hi Andrew,

Werner F. Bruhin wrote:
> Hi Andrew,
>
> Andrew Straw wrote:
>   
>> Dear Werner,
>>
>> This seems to be an unintended side-effect of reorganizing the mpl 
>> data file location that I did prior to this release. (I.e. it's not 
>> your code that broke, I think it's mpl.) Unfortunately, since I didn't 
>> (and still don't) use py2exe, it will be hard for me to fix this. Can 
>> you send a patch that gets py2exe working again?
>> 
> The work around I did is using glob.glob instead as follows:
>
> # matplotlib data
> ##mpdir, mpfiles = matplotlib.get_py2exe_datafiles()
> mpfiles = glob.glob('C:\Python25\lib\site-packages\matplotlib\mpl-data\*.*')
>
> But I can't confirm yet that this works as I am also trying out 
> something else in my InnoSetup script.  Will confirm ASAP and will try 
> and look into matplotlib.get_py2exe_datafiles() and see how it could be 
> fixed.
>   
I have change matplotlib.get_py2exe_datafiles() to:
def get_py2exe_datafiles():
import glob
   
mplfiles = []
for item in glob.glob(os.sep.join([get_data_path(), '*/*'])):
if os.path.isdir(item):
mplfiles += glob.glob(os.sep.join([item, '/*']))
   
mplfiles.append(os.sep.join([get_data_path(), 'matplotlibrc']))

try:
mplfiles.remove(os.sep.join([get_data_path(), 'Matplotlib.nib']))
except:
pass

return ('matplotlibdata', mplfiles)

Now this creates a "flat" folder, i.e. all datafiles are directly under 
matplotlibdata.  In my tests this works for me in my limited tests, with 
the exception that I also get the "Could not match Bitstream Vera 
..etc" error - but this is something I also get with py2exe, so I 
don't know if this is an issue.

Andrew, do you know if the sub-folder structure should be retained when 
using py2exe for matplotlib to work correctly in all circumstances?  If 
that would be the case let me know and I try to come up with something.

Werner

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


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

2007-06-08 Thread Werner F. Bruhin

Hi Andrew,

Andrew Straw wrote:

...
Dear Werner,

I am reluctant to eliminate the sub-folder structure because I think 
it would add the possibility of unnecessary bugs to just the py2exe 
built version. Would it be possible for you to re-factor this to 
include the directory layout? When you test it, can you test some 
interactive plot to make sure all the button icons are loaded properly?
I don't know how to change "matplotlib.get_py2exe_datafiles()" to retain 
the folder structure.  But in the attached setup.py I used 
"matplotlib.get_data_path()" for each of the sub-folders and then define 
the folder structure again in the py2exe "data_files" section.  The 
enclosed setup.py builds an exe for embedding_in_wx.py and I have no 
problems running it and the toolbar shows all its icons.


I am also enclosing some example files which I have upgraded to the new 
wxPython namespace - I had sent them some time ago but the examples.zip 
file I just downloaded contains the old versions.


dynamic_demo_wx.py, namespace changes and a OnClose event to stop the 
timer (otherwise the script can not be stopped by clicking on the X).

dynamic_image_wxagg.py, namespace changes
dynamic_image_wxagg2.py, namespace changes and removed numarray stuff.
embedding_in_wx.py, namespace changes
embedding_in_wx2.py, namespace changes
embedding_in_wx4.py, namespace changes

Can you update the zip file with the above files?

Best regards
Werner
#!/usr/bin/env python
"""
An example of how to use wx or wxagg in an application with a custom
toolbar
"""

from matplotlib.numerix import arange, sin, pi

import matplotlib

# uncomment the following to use wx rather than wxagg
#matplotlib.use('WX')
#from matplotlib.backends.backend_wx import FigureCanvasWx as FigureCanvas

# comment out the following to use wx rather than wxagg
matplotlib.use('WXAgg')
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas
from matplotlib.backends.backend_wxagg import NavigationToolbar2WxAgg

from matplotlib.backends.backend_wx import _load_bitmap
from matplotlib.figure import Figure
from matplotlib.numerix.mlab import rand

import wx

class MyNavigationToolbar(NavigationToolbar2WxAgg):
"""
Extend the default wx toolbar with your own event handlers
"""
ON_CUSTOM = wx.NewId()
def __init__(self, canvas, cankill):
NavigationToolbar2WxAgg.__init__(self, canvas)

# for simplicity I'm going to reuse a bitmap from wx, you'll
# probably want to add your own.
self.AddSimpleTool(self.ON_CUSTOM, _load_bitmap('stock_left.xpm'),
   'Click me', 'Activate custom contol')
self.Bind(wx.EVT_TOOL, self._on_custom, id=self.ON_CUSTOM)

def _on_custom(self, evt):
# add some text to the axes in a random location in axes (0,1)
# coords) with a random color

# get the axes
ax = self.canvas.figure.axes[0]

# generate a random location can color
x,y = tuple(rand(2))
rgb = tuple(rand(3))

# add the text and draw
ax.text(x, y, 'You clicked me',
transform=ax.transAxes,
color=rgb)
self.canvas.draw()
evt.Skip()


class CanvasFrame(wx.Frame):

def __init__(self):
wx.Frame.__init__(self,None,-1,
 'CanvasFrame',size=(550,350))

self.SetBackgroundColour(wx.NamedColor("WHITE"))

self.figure = Figure(figsize=(5,4), dpi=100)
self.axes = self.figure.add_subplot(111)
t = arange(0.0,3.0,0.01)
s = sin(2*pi*t)

self.axes.plot(t,s)

self.canvas = FigureCanvas(self, -1, self.figure)

self.sizer = wx.BoxSizer(wx.VERTICAL)
self.sizer.Add(self.canvas, 1, wx.TOP | wx.LEFT | wx.EXPAND)
# Capture the paint message
self.Bind(wx.EVT_PAINT, self.OnPaint)

self.toolbar = MyNavigationToolbar(self.canvas, True)
self.toolbar.Realize()
if wx.Platform == '__WXMAC__':
# Mac platform (OSX 10.3, MacPython) does not seem to cope with
# having a toolbar in a sizer. This work-around gets the buttons
# back, but at the expense of having the toolbar at the top
self.SetToolBar(self.toolbar)
else:
# On Windows platform, default window size is incorrect, so set
# toolbar width to figure width.
tw, th = self.toolbar.GetSizeTuple()
fw, fh = self.canvas.GetSizeTuple()
# By adding toolbar in sizer, we are able to put it at the bottom
# of the frame - so appearance is closer to GTK version.
# As noted above, doesn't work for Mac.
self.toolbar.SetSize(wx.Size(fw, th))
self.sizer.A

Re: [Matplotlib-users] Redundant error message when using wxAgg with wxPython 2.8

2007-06-08 Thread Werner F. Bruhin
Hi Sturla,

Sturla Molden wrote:
> There is an annoying bug when using wxAgg backend with wxPython 2.8 on 
> Windows. Whenever matplotlib is imported, we get a modal message box 
> displaying the error message:
>
> "This application has failed to start because wxmsw26uh_vc.dll was not 
> found. Reinstalling the application may fix this problem."
>
> After clicking OK, everything works fine.
>
>
> Here is a bugfix:
>   
If you use the new matplotlib 0.90.1 version then this has gone away.

Werner

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


  1   2   >