.NET backend

My source code posting seems to have bounced. I got the

    > following message: host mail.sourceforge.net
    > [66.35.250.206]: 550-"For the time being, we are blocking
    > all mail with the .zip extension....

If you email it to me, I'll post it on the matplotlib web site, and
follow-up here with a link to it. Best if you include all the code
(*.py and *.c) in one zip along with the pyd and any examples since
the sf archives won't include your previous plain text)attachments,
and it will be easiest for people searching the archives to get
everything in one bundle.

Can you clarify something for me? In the backend comments you wrote

    0.2.0 11/01/04 Created a DLL for the backend. Should work with any .NET machine.

It's still the case, isn't it, that matplotlib itself will not work on
a general .Net machine? In particular, it won't work on IronPython
because it uses numerix extension code as well as it's own, right?
How does PythonNet handle this problem, and is it fair to say that
matplotlib with your backend currently work only on PythonNet?

Thanks!
JDH

Thanks John, I'll be forwarding the source separately. Now to your
questions:

1. [JDH] It's still the case, isn't it, that matplotlib itself will not
work on a general .Net machine?
[TKP] No. Matplotlib DOES work on a general .Net machine. I've run
successful -- but not exhaustive -- tests of the "DotNet" backend on
("normal") CPython 2.3, and PythonNet.

2. [JDH] In particular, it won't work on IronPython because it uses numerix
extension code as well as it's own, right?
[TKP] Yes and no. Matplotlib doesn't work on IronPython (yet) as the
supporting libraries are not yet there. (With some effort, this might be
feasible with PyPy.) However, the "DotNet" backend (DLL) works just fine.
Output from the session below creates a graphic window and draws a blue line
on it. This isn't too useful except to note that once the libraries are in
place, matplotlib will indeed work on IronPython.

C:\Python\IronPython-0.6\bin>IronPythonConsole

import sys
sys.LoadAssemblyFromFile("./_backend_dotnet.pyd")
foo = backend_dotnet.GraphicsForm(640, 480)

IronPython.Objects.PythonNameError: name 'backend_dotnet' is not defined
   at IronPython.Objects.Frame.GetGlobal(String name)
   at input_2.Run(Frame frame)
   at IronPythonConsole.IronPython.DoInteractive()

import backend_dotnet
foo = backend_dotnet.GraphicsForm(640, 480)
from System.Drawing import *
bar = Color.Blue
bar

Color [Blue]

pen = Pen(bar)
pen

<System.Drawing.Pen object at 0x00000021>

foo.draw_line(pen, 0, 0, 100, 100)
foo.Repaint()

3. [JDH] How does PythonNet handle this problem, and is it fair to say that
matplotlib with your backend currently work only on PythonNet?
[TKP] That was the case, but isn't any longer. A bit of history... I
originally wrote the backend in PythonNet, and consequently it would only
work with the PythonNet distribution. However, (foolishly) encouraged by my
success, I wrote a DLL so that this backend could work with any .Net
machine. I say foolishly, because the DLL took about 5 times as long to
write as the Python version! It now works also with the "regular" Python
(aka CPython) distribution.

···

-----Original Message-----
From: John Hunter [mailto:jdhunter@…5…]
Sent: Friday, November 05, 2004 9:30 AM
To: thane@…146…
Cc: 'Andrew Straw'; matplotlib-devel@lists.sourceforge.net
Subject: Re: [matplotlib-devel] .NET backend

    > My source code posting seems to have bounced. I got the
    > following message: host mail.sourceforge.net
    > [66.35.250.206]: 550-"For the time being, we are blocking
    > all mail with the .zip extension....

If you email it to me, I'll post it on the matplotlib web site, and
follow-up here with a link to it. Best if you include all the code
(*.py and *.c) in one zip along with the pyd and any examples since
the sf archives won't include your previous plain text)attachments,
and it will be easiest for people searching the archives to get
everything in one bundle.

Can you clarify something for me? In the backend comments you wrote

    0.2.0 11/01/04 Created a DLL for the backend. Should work with any
.NET machine.

It's still the case, isn't it, that matplotlib itself will not work on
a general .Net machine? In particular, it won't work on IronPython
because it uses numerix extension code as well as it's own, right?
How does PythonNet handle this problem, and is it fair to say that
matplotlib with your backend currently work only on PythonNet?

Thanks!
JDH