Skip to content
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

MultiCursor with additionnal optionnal horizontal bar #1811

Merged
merged 3 commits into from Mar 11, 2013

Conversation

davidtrem
Copy link
Contributor

This pull request proposed an improved MultiCursor widget that allows to select either vertical (default) and/or horizontal cursor lines. Previous Multicursor was vertical bar only.
The default behavior of Multicursor is fully preserved by this pull request.

@@ -943,8 +954,18 @@ def __init__(self, canvas, axes, useblit=True, **lineprops):

if useblit:
lineprops['animated'] = True
self.lines = [ax.axvline(xmid, visible=False, **lineprops)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Obviously this breaks backwards compatibility with self.lines - I don't think that's a problem, but it should be documented in doc/api/api_changes.rst. I wonder if it's worth providing a property which returns the union of self.vlines and self.hlines - on second thoughts, that doesn't really help if users want to do self.lines.append(...) so scrap the property idea.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see...
May we keep self.lines pointing to self.vlines ?
Or replace all occurrence of self.vlines by self.lines
Both solution prevent api changes...
What would you prefer ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can just document the change. I think this is a small change which I can't see having a major impact to many codes - I'd sooner have the consistency of what you have implemented, than the inconsistency that not breaking compatibility would bring.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. A new commit document this small API change in doc/api/api_changes.rst

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For backwards compatibility, why don't we set up a property "self.lines" that would point to self.vlines, but puts out a deprecation message?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep. That works, nice idea.

@pelson
Copy link
Member

pelson commented Mar 7, 2013

I've not tried it out, but 👍 from me. Anybody else want to comment? @WeatherGod - I know you've done some work with the widgets in the past.

Thanks for this @davidtrem .

@NelleV
Copy link
Member

NelleV commented Mar 11, 2013

LGTM 👍

mdboom added a commit that referenced this pull request Mar 11, 2013
MultiCursor with additionnal optionnal horizontal bar
@mdboom mdboom merged commit 91eb1a9 into matplotlib:master Mar 11, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants