tag:infinitekind.tenderapp.com,2009-01-14:/discussions/moneydance-development/1801-graphs-in-python-extensionsInfinite Kind: Discussion 2017-06-16T17:00:23Ztag:infinitekind.tenderapp.com,2009-01-14:Comment/421670802017-03-16T02:19:52Z2017-03-16T02:19:53ZGraphs in python extensions<div><p>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:</p>
<p>1) I don't really know how moneydance's python interpreter works. How can I get the matplotlib module installed into it?<br>
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.</p></div>jstarxtag:infinitekind.tenderapp.com,2009-01-14:Comment/421670802017-03-17T16:54:51Z2017-03-17T16:54:51ZGraphs in python extensions<div><p>Hi jstarx,</p>
<p>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 <a href="https://infinitekind.com/preview">https://infinitekind.com/preview</a> 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 <em>should</em> let it work.</p>
<p>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.</p>
<p>Thanks!</p>
<p>Sean Reilly<br>
Developer, The Infinite Kind<br>
<a href="http://infinitekind.com">http://infinitekind.com</a></p></div>Sean Reilly