Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
ENH: first draft of ensure_ax decorator#4488
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes from1 commit
ffdbe6e
a7918be
d271189
3501059
8351ceb
5feeb53
fe8eb34
9c0859b
f9ace37
c44b7dd
e398ad8
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
- Loading branch information
Uh oh!
There was an error while loading.Please reload this page.
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -261,6 +261,33 @@ def inner(*args, **kwargs): | ||
return inner | ||
def register_func(func): | ||
""" | ||
Registers a function to be wrapped and made available in the | ||
pyplot namespace for convenient interactive command line use. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. command-line use? Might be misleading. Would probably be better as just "interactive use". There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. I want to keep something in there so we don't encourage people to use these I am a bit hesitant to include this at all for exactly that reason. On Tue, Jul 7, 2015, 3:06 PM Benjamin Rootnotifications@github.com wrote:
| ||
Parameters | ||
---------- | ||
func : callable | ||
First parameter of function must be an `Axes` object. Will | ||
be wrapped by `ensure_ax` | ||
Returns | ||
------- | ||
callable | ||
The wrapped function. | ||
""" | ||
mod = sys.modules[__name__] | ||
f_name = func.__name__ | ||
if hasattr(mod, f_name): | ||
raise RuntimeError("Function already exists with that name") | ||
setattr(mod, f_name, ensure_ax(func)) | ||
return getattr(mod, f_name) | ||
@docstring.copy_dedent(Artist.findobj) | ||
def findobj(o=None, match=None, include_self=True): | ||
if o is None: | ||