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
undefined behavior of figure.add_subplot() once subplot is modified. #429
Comments
I am inclined to think that the whole business of keeping a key and allowing add_subplot() to return an existing axes if the key is matched is a mistake--extra complexity for minimal gain. Is there a major use case for this that would be substantially more difficult to handle without it? |
I agree with efiring, wouldn't it be better to simply separate the {add,get}_subplot functionality? Whenever I use |
I agree. More evidence that keeping track of the axes via hash, at all, is hard (and error prone):
|
I am closing this because it seems to be fixed (@pelson 's example now returns |
Cool. Thanks for spotting @tacaswell - I think I might have fixed this some time ago between v1.1 and v1.2 to aid in the Cartopy interfacing. |
This issue doesn't seem to be fixed... Or it cropped back up since this one is pretty old. See this stackoverflow link for an example. http://stackoverflow.com/questions/31600726/matplotlib-add-subplot-change-geometry-bug |
Modifying a subplot using
change_geometry()
method does not update the corresponding key for the subplot in the figure. So when you calladd_subplot()
, you need to call it with the original _args and *_kwargs not the modified ones, if you want to access the already existing subplot.This was identified in matplotlib version 0.99.1.1, but looking at the current code in github, it appears the same behavior exists.
The text was updated successfully, but these errors were encountered: