Discussion:
[Matplotlib-users] plot problem
Juan Wu
2015-05-16 15:50:40 UTC
Permalink
Hi, List experts,

I have a matplotlib problem when I tried to use a tool called HDDM. As
HDDM is another issue, I here just post my problem with Matplotlib. In
short, the error alarm appeard when I input fig = plt.figure(). I am a
beginner with those stuff.

I would appreciate if anyone can give me any good pointers.

Thanks so much,
Juan

==================

In [8]: fig = plt.figure()
<matplotlib.figure.Figure at 0x13293890>

In [9]: ax = fig.add_subplot(111, xlabel='RT', ylabel='count',
title='RT distributions')

In [10]: for i, subj_data in data.groupby('subj_idx'):
...: subj_data.rt.hist(bins=20, histtype='step', ax=ax)
...: plt.savefig('hddm_demo_fig_00.pdf')

<matplotlib.figure.Figure at 0x1354cb70>
Traceback (most recent call last):

File "<ipython-input-15-3b0b3c83094c>", line 2, in <module>
subj_data.rt.hist(bins=20, histtype='step', ax=ax)

File "C:\Anaconda\lib\site-packages\pandas\tools\plotting.py", line
2830, in hist_series
raise AssertionError('passed axis not bound to passed figure')

AssertionError: passed axis not bound to passed figure

(relevant link: https://groups.google.com/forum/#!topic/hddm-users/yBeIRJaHGwo
there very few experts view and reply questions)
Thomas Caswell
2015-05-16 15:57:05 UTC
Permalink
This is coming out of the pandas plotting tools, you might get better
answers on their mailing list.

Tom
Post by Juan Wu
Hi, List experts,
I have a matplotlib problem when I tried to use a tool called HDDM. As
HDDM is another issue, I here just post my problem with Matplotlib. In
short, the error alarm appeard when I input fig = plt.figure(). I am a
beginner with those stuff.
I would appreciate if anyone can give me any good pointers.
Thanks so much,
Juan
==================
In [8]: fig = plt.figure()
<matplotlib.figure.Figure at 0x13293890>
In [9]: ax = fig.add_subplot(111, xlabel='RT', ylabel='count',
title='RT distributions')
...: subj_data.rt.hist(bins=20, histtype='step', ax=ax)
...: plt.savefig('hddm_demo_fig_00.pdf')
<matplotlib.figure.Figure at 0x1354cb70>
File "<ipython-input-15-3b0b3c83094c>", line 2, in <module>
subj_data.rt.hist(bins=20, histtype='step', ax=ax)
File "C:\Anaconda\lib\site-packages\pandas\tools\plotting.py", line
2830, in hist_series
raise AssertionError('passed axis not bound to passed figure')
AssertionError: passed axis not bound to passed figure
https://groups.google.com/forum/#!topic/hddm-users/yBeIRJaHGwo
there very few experts view and reply questions)
------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Matplotlib-users mailing list
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Benjamin Root
2015-05-18 16:04:28 UTC
Permalink
I noticed in your output that another figure seems to have been created
(you see its output as "<matplotlib.figure.Figure at 0x1354cb70>"). It
would be useful to add some print statements to figure out exactly which
line is emitting that. Second, you are calling "plt.savefig()" in the
for-loop for the same filename. I suspect that isn't what you want. I am
going to assume that you want to save a final figure after the for-loop is
complete, right?

Also, it would be more clear to use "fig.savefig()" instead of the more
"magical" plt.savefig() as the latter would automatically create a figure
if one didn't exist for some reason.

Ben Root
Post by Thomas Caswell
This is coming out of the pandas plotting tools, you might get better
answers on their mailing list.
Tom
Post by Juan Wu
Hi, List experts,
I have a matplotlib problem when I tried to use a tool called HDDM. As
HDDM is another issue, I here just post my problem with Matplotlib. In
short, the error alarm appeard when I input fig = plt.figure(). I am a
beginner with those stuff.
I would appreciate if anyone can give me any good pointers.
Thanks so much,
Juan
==================
In [8]: fig = plt.figure()
<matplotlib.figure.Figure at 0x13293890>
In [9]: ax = fig.add_subplot(111, xlabel='RT', ylabel='count',
title='RT distributions')
...: subj_data.rt.hist(bins=20, histtype='step', ax=ax)
...: plt.savefig('hddm_demo_fig_00.pdf')
<matplotlib.figure.Figure at 0x1354cb70>
File "<ipython-input-15-3b0b3c83094c>", line 2, in <module>
subj_data.rt.hist(bins=20, histtype='step', ax=ax)
File "C:\Anaconda\lib\site-packages\pandas\tools\plotting.py", line
2830, in hist_series
raise AssertionError('passed axis not bound to passed figure')
AssertionError: passed axis not bound to passed figure
https://groups.google.com/forum/#!topic/hddm-users/yBeIRJaHGwo
there very few experts view and reply questions)
------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Matplotlib-users mailing list
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Matplotlib-users mailing list
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Loading...