Skip to content

BUG: matplotlib inset-axis #10407 #11065

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

d1manson
Copy link

This is the issue: #10407
I just added a bunch of try-catch AttributeError around the offending code - it seemed to do the trick for me.

@jreback
Copy link
Contributor

jreback commented Sep 12, 2015

this would need a test

@sinhrks
Copy link
Member

sinhrks commented Sep 12, 2015

Thanks, this is also a side effect of #9740.

However, example in #10407 looks work on current master and matplotlib 1.4.3, maybe fixed by #10879. Can you show another example which causes a problem? Of course it is very nice to add an explicit tests for this.

@jreback jreback changed the title quick fix for issue #10407 BUG: matplotlib inset-axis #10407 Oct 12, 2015
@jreback
Copy link
Contributor

jreback commented Oct 12, 2015

@d1manson can you update according to comments

@jreback
Copy link
Contributor

jreback commented Oct 25, 2015

@d1manson pls update

@patclaffey
Copy link

Here is some information from pd.show_versions()
python: 3.4.0.final.0
pandas: 0.17.0
matplotlib: 1.4.3

I want to use add_axes instead of subplots. The problem with subplots is that all subplot are the same height. The advantage of add_axes is that subplots can be created easily with different heights. For my use case I need the first subplot to be smaller in height than subsequent subplots.

Here is a simple test case to reproduce the problem on in pandas 17.0:
df_test = pd.DataFrame([1,2,3,4]) # create DataFrame
fig_test = plt.figure() # create the figure instance

#add_axes : Add an axes at position rect [left, bottom, width, height]
#where all quantities are in fractions of figure width and height.
axes_a = fig_test.add_axes([0.1, 0.1, 0.8, 0.4])
df_test.plot(ax = axes_a, title = 'Lower')
axes_b = fig_test.add_axes([0.1, 0.6, 0.8, 0.2])
df_test.plot(ax = axes_b, title = 'Higher')

This causes error AttributeError: 'Axes' object has no attribute 'rowNum'

I really need this functionality - looks like I need to downgrade pandas.

@jorisvandenbossche
Copy link
Member

I think this one is trying to solve the same underlying issue as what I tried to solve with #11561, which is now merged.

@patclaffey normally your example should work in the master version of pandas now.

@jorisvandenbossche
Copy link
Member

@d1manson the approach I took in my fix was to just not call this function (_handle_shared_axes) when not having a SubplotAxes, instead of catching the AttributeError. Sorry I didn't see this before, but thanks for working on it!

@jorisvandenbossche jorisvandenbossche added this to the No action milestone Nov 15, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants