<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	>
<channel>
	<title>Comments on: matplotlib with wxPython GUIs</title>
	<atom:link href="http://eli.thegreenplace.net/2008/08/01/matplotlib-with-wxpython-guis/feed/" rel="self" type="application/rss+xml" />
	<link>http://eli.thegreenplace.net/2008/08/01/matplotlib-with-wxpython-guis/</link>
	<description>Eli Bendersky's personal website</description>
	<pubDate>Thu, 08 Jan 2009 00:02:30 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Ron Adelman</title>
		<link>http://eli.thegreenplace.net/2008/08/01/matplotlib-with-wxpython-guis/comment-page-1/#comment-133024</link>
		<dc:creator>Ron Adelman</dc:creator>
		<pubDate>Tue, 30 Sep 2008 13:34:54 +0000</pubDate>
		<guid isPermaLink="false">http://eli.thegreenplace.net/2008/08/01/matplotlib-with-wxpython-guis/#comment-133024</guid>
		<description>Exactly what I was looking  for.  I have graphs in my application, but not on figurecanvas.  I was just trying to get a barchart with wx and was headed down the wrong track.  Snippits will save me some time.  Thanks</description>
		<content:encoded><![CDATA[<p>Exactly what I was looking  for.  I have graphs in my application, but not on figurecanvas.  I was just trying to get a barchart with wx and was headed down the wrong track.  Snippits will save me some time.  Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: eliben</title>
		<link>http://eli.thegreenplace.net/2008/08/01/matplotlib-with-wxpython-guis/comment-page-1/#comment-131188</link>
		<dc:creator>eliben</dc:creator>
		<pubDate>Fri, 19 Sep 2008 06:18:02 +0000</pubDate>
		<guid isPermaLink="false">http://eli.thegreenplace.net/2008/08/01/matplotlib-with-wxpython-guis/#comment-131188</guid>
		<description>Evert,
Thanks. I've updated the file to reflect this fix.</description>
		<content:encoded><![CDATA[<p>Evert,<br />
Thanks. I&#8217;ve updated the file to reflect this fix.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Evert</title>
		<link>http://eli.thegreenplace.net/2008/08/01/matplotlib-with-wxpython-guis/comment-page-1/#comment-130750</link>
		<dc:creator>Evert</dc:creator>
		<pubDate>Mon, 15 Sep 2008 15:42:40 +0000</pubDate>
		<guid isPermaLink="false">http://eli.thegreenplace.net/2008/08/01/matplotlib-with-wxpython-guis/#comment-130750</guid>
		<description>Eli, for your (and possibly other people's) records: I now know what caused this.
wxStaticBox/Sizer needs to be created &lt;i&gt;before&lt;/i&gt; any of the controls inside it are created, otherwise it'll draw on top of those of controls, and while you may be able to see them, you cannot "reach" (click) them. MS Windows (XP) is apparently a bit more forgiving there, so it worked for you (or it's actually broken there, as I don't know what's the correct way to do this); apparently, with GTK it can even crash.

So, the solution is to take the following two lines in the BoundControlBox's __init__() method (wx_mpl_dynamic_graph.py), and move them up, just before the self.radio_auto is created:

&lt;pre&gt;
        self.value = initval

        box = wx.StaticBox(self, -1, label)
        sizer = wx.StaticBoxSizer(box, wx.VERTICAL)

        self.radio_auto = wx.RadioButton(self, -1, 
            label="Auto", style=wx.RB_GROUP)

&lt;/pre&gt;

Then it works splendidly for me, and probably also on other platforms/window environments.
More details at &lt;a href="http://wiki.wxwidgets.org/WxWiki_WxCaret#wxStaticBoxSizer" rel="nofollow"&gt;the wxwidgets.org wiki&lt;/a&gt; or eg &lt;a href="http://lists.wxwidgets.org/pipermail/wxpython-users/2008-March/073306.html" rel="nofollow"&gt;this post&lt;/a&gt; in a mailinglist.</description>
		<content:encoded><![CDATA[<p>Eli, for your (and possibly other people&#8217;s) records: I now know what caused this.<br />
wxStaticBox/Sizer needs to be created <i>before</i> any of the controls inside it are created, otherwise it&#8217;ll draw on top of those of controls, and while you may be able to see them, you cannot &#8220;reach&#8221; (click) them. MS Windows (XP) is apparently a bit more forgiving there, so it worked for you (or it&#8217;s actually broken there, as I don&#8217;t know what&#8217;s the correct way to do this); apparently, with GTK it can even crash.</p>
<p>So, the solution is to take the following two lines in the BoundControlBox&#8217;s __init__() method (wx_mpl_dynamic_graph.py), and move them up, just before the self.radio_auto is created:</p>
<pre>
        self.value = initval

        box = wx.StaticBox(self, -1, label)
        sizer = wx.StaticBoxSizer(box, wx.VERTICAL)

        self.radio_auto = wx.RadioButton(self, -1,
            label="Auto", style=wx.RB_GROUP)
</pre>
<p>Then it works splendidly for me, and probably also on other platforms/window environments.<br />
More details at <a href="http://wiki.wxwidgets.org/WxWiki_WxCaret#wxStaticBoxSizer" rel="nofollow">the wxwidgets.org wiki</a> or eg <a href="http://lists.wxwidgets.org/pipermail/wxpython-users/2008-March/073306.html" rel="nofollow">this post</a> in a mailinglist.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Evert</title>
		<link>http://eli.thegreenplace.net/2008/08/01/matplotlib-with-wxpython-guis/comment-page-1/#comment-130306</link>
		<dc:creator>Evert</dc:creator>
		<pubDate>Wed, 10 Sep 2008 19:08:18 +0000</pubDate>
		<guid isPermaLink="false">http://eli.thegreenplace.net/2008/08/01/matplotlib-with-wxpython-guis/#comment-130306</guid>
		<description>Tried with a up-to-date version (2.8.8.1) of wxPython; no luck.
So I guess it's more intrinsic to OS X/Aqua or so. 
If I ever find out, I might come back here to let you know; but that could be a few months (no hurry getting this right, as I don't need it yet. I'm just playing around right now).</description>
		<content:encoded><![CDATA[<p>Tried with a up-to-date version (2.8.8.1) of wxPython; no luck.<br />
So I guess it&#8217;s more intrinsic to OS X/Aqua or so.<br />
If I ever find out, I might come back here to let you know; but that could be a few months (no hurry getting this right, as I don&#8217;t need it yet. I&#8217;m just playing around right now).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: eliben</title>
		<link>http://eli.thegreenplace.net/2008/08/01/matplotlib-with-wxpython-guis/comment-page-1/#comment-130273</link>
		<dc:creator>eliben</dc:creator>
		<pubDate>Wed, 10 Sep 2008 14:40:49 +0000</pubDate>
		<guid isPermaLink="false">http://eli.thegreenplace.net/2008/08/01/matplotlib-with-wxpython-guis/#comment-130273</guid>
		<description>Evert,

Your version of wxPython does look a bit old... 
Though I don't know much about OS X :-)</description>
		<content:encoded><![CDATA[<p>Evert,</p>
<p>Your version of wxPython does look a bit old&#8230;<br />
Though I don&#8217;t know much about OS X <img src='http://eli.thegreenplace.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Evert</title>
		<link>http://eli.thegreenplace.net/2008/08/01/matplotlib-with-wxpython-guis/comment-page-1/#comment-130265</link>
		<dc:creator>Evert</dc:creator>
		<pubDate>Wed, 10 Sep 2008 11:54:41 +0000</pubDate>
		<guid isPermaLink="false">http://eli.thegreenplace.net/2008/08/01/matplotlib-with-wxpython-guis/#comment-130265</guid>
		<description>Eli, looks great! I was just Googling around for wxPython &#38; matplotlib coming across these examples; great starting points.
One thing: when trying on my Mac, the second example didn't fully work: the radio buttons weren't available, and I saw only one run of the live data. Could that be because of the wxPython version that ships with OS X 10.5? It's 2.8.4.0, matplotlib is 0.98.0. Or is it just intrinsic to the OS X GUI?</description>
		<content:encoded><![CDATA[<p>Eli, looks great! I was just Googling around for wxPython &amp; matplotlib coming across these examples; great starting points.<br />
One thing: when trying on my Mac, the second example didn&#8217;t fully work: the radio buttons weren&#8217;t available, and I saw only one run of the live data. Could that be because of the wxPython version that ships with OS X 10.5? It&#8217;s 2.8.4.0, matplotlib is 0.98.0. Or is it just intrinsic to the OS X GUI?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris</title>
		<link>http://eli.thegreenplace.net/2008/08/01/matplotlib-with-wxpython-guis/comment-page-1/#comment-125602</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Tue, 12 Aug 2008 22:25:45 +0000</pubDate>
		<guid isPermaLink="false">http://eli.thegreenplace.net/2008/08/01/matplotlib-with-wxpython-guis/#comment-125602</guid>
		<description>Sorry - was using latest marked stable on Gentoo 0.91.2 - update to matplotlib-0.98.1 fixed it.

Afaik the problem was between those two lines of draw_plot. Once you updated x - and before you updated y - the two didn't match. Obviously now matplotlib handle it safely.

Thanks</description>
		<content:encoded><![CDATA[<p>Sorry - was using latest marked stable on Gentoo 0.91.2 - update to matplotlib-0.98.1 fixed it.</p>
<p>Afaik the problem was between those two lines of draw_plot. Once you updated x - and before you updated y - the two didn&#8217;t match. Obviously now matplotlib handle it safely.</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: eliben</title>
		<link>http://eli.thegreenplace.net/2008/08/01/matplotlib-with-wxpython-guis/comment-page-1/#comment-125585</link>
		<dc:creator>eliben</dc:creator>
		<pubDate>Tue, 12 Aug 2008 17:38:18 +0000</pubDate>
		<guid isPermaLink="false">http://eli.thegreenplace.net/2008/08/01/matplotlib-with-wxpython-guis/#comment-125585</guid>
		<description>Chris,
Are you sure you didn't change anything and / or have the up-to-date version of matplotlib ? 

The only two places in the code that populate the plot with data are:

1. In the end of init_plot()
&lt;pre lang='python'&gt;
        self.plot_data = self.axes.plot(
            self.data, 
            linewidth=1,
            color=(1, 1, 0),
            )[0]
&lt;/pre&gt;

This only fills in the y axis, x will be automatically done by axes.plot

2. In the end of draw_plot()

&lt;pre lang='python'&gt;
        self.plot_data.set_xdata(np.arange(len(self.data)))
        self.plot_data.set_ydata(np.array(self.data))
&lt;/pre&gt;

These two obviously create arrays of the same length.</description>
		<content:encoded><![CDATA[<p>Chris,<br />
Are you sure you didn&#8217;t change anything and / or have the up-to-date version of matplotlib ? </p>
<p>The only two places in the code that populate the plot with data are:</p>
<p>1. In the end of init_plot()</p>
<pre lang='python'>
        self.plot_data = self.axes.plot(
            self.data,
            linewidth=1,
            color=(1, 1, 0),
            )[0]
</pre>
<p>This only fills in the y axis, x will be automatically done by axes.plot</p>
<p>2. In the end of draw_plot()</p>
<pre lang='python'>
        self.plot_data.set_xdata(np.arange(len(self.data)))
        self.plot_data.set_ydata(np.array(self.data))
</pre>
<p>These two obviously create arrays of the same length.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris</title>
		<link>http://eli.thegreenplace.net/2008/08/01/matplotlib-with-wxpython-guis/comment-page-1/#comment-125583</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Tue, 12 Aug 2008 14:35:39 +0000</pubDate>
		<guid isPermaLink="false">http://eli.thegreenplace.net/2008/08/01/matplotlib-with-wxpython-guis/#comment-125583</guid>
		<description>Live graph one failed with :
RuntimeError: xdata and ydata must be the same length</description>
		<content:encoded><![CDATA[<p>Live graph one failed with :<br />
RuntimeError: xdata and ydata must be the same length</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brett_McS</title>
		<link>http://eli.thegreenplace.net/2008/08/01/matplotlib-with-wxpython-guis/comment-page-1/#comment-125197</link>
		<dc:creator>Brett_McS</dc:creator>
		<pubDate>Tue, 05 Aug 2008 21:46:24 +0000</pubDate>
		<guid isPermaLink="false">http://eli.thegreenplace.net/2008/08/01/matplotlib-with-wxpython-guis/#comment-125197</guid>
		<description>Fantastic.  I've been using matplotlib for a while, and have done a bit of wxPython, but have never put the two together.  This should get me started.  Many thanks.</description>
		<content:encoded><![CDATA[<p>Fantastic.  I&#8217;ve been using matplotlib for a while, and have done a bit of wxPython, but have never put the two together.  This should get me started.  Many thanks.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
