Graphs in python extensions

jstarx's Avatar

jstarx

16 Mar, 2017 02:19 AM

I'm trying to write an extension in python that display's a graph. My normal goto in python for graphing is matplotlib but if I run an extension script that tries to include matplotlib then it fails to find the module. So I have two questions:

1) I don't really know how moneydance's python interpreter works. How can I get the matplotlib module installed into it?
2) What is the recommended method for an extension to create a graph? I've been reading about javax.swing and it seems to have many nice ready made GUI features but I couldn't find anything that looked like it was tailor made to create graphs.

  1. Support Staff 1 Posted by Sean Reilly on 17 Mar, 2017 04:54 PM

    Sean Reilly's Avatar

    Hi jstarx,

    That's a great question! Moneydance (at least on the desktop) uses the jython interpreter (from jython.org) but it can bundle some python libraries as long as they don't depend on CPython symbols. At first glance it seems that matplotlib doesn't depend upon native libraries so I've bundled the library starting with the next update to Moneydance. When build 1605 is available at https://infinitekind.com/preview it will include this library automatically. In the meantime, if you run your scripts from the built-in Python Runner under the Window menu then copying python's matplotlib folder to the folder that contains your script should let it work.

    There's also the option to access the jfreechart libraries which are always bundled with Moneydance and you can talk to via the python-java bridging. Moneydance itself uses the JFreeChart libraries.

    Thanks!

    Sean Reilly
    Developer, The Infinite Kind
    http://infinitekind.com

  2. System closed this discussion on 16 Jun, 2017 05:00 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac