-
Notifications
You must be signed in to change notification settings - Fork 0
figure attribute and canvas property #6
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
figure attribute and canvas property #6
Conversation
|
The errors seem unrelated |
|
Yes, the same errors as I have in MEP27, just put in a fix for that... |
|
@fariza I think this will pass. I will give it a quick check over when I come back this evening and merge if okay and then I will work on the the Tom's nits. Do you want to work on the example(s) as you know what you want to see. Also any idea how to fix the bug in the example? Basically a focus bug, with elements to the left, above of GTK gaining focus first, which means they get the keyboard events and not the canvas -> toolmanager, until you tab focus to the canvas. On the stable release if you press tab the canvas looses focus, but I see that as a UI issue for another PR. Just want to make sure it has the correct focus if it has no user interaction... |
|
Very nice, I especially like how you use add in the canvas property. It keeps it the same, yet adds in an extra layer of validation meaning one can't change the figure and canvas independently :). |
lib/matplotlib/backend_managers.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line looks redundant... this gets set with the next line.
Also do we want to have no figure?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is not that we want to have no figure (when the figure will be changeable we'll want that option).
In general, I like to declare all the attributes at __init__ and I am not doing self._figure = self._set_figure(figure) because I want to transform that latter into a property setter.
|
In this moment I didn't introduce the possibility of |
|
@fariza Answering to your reply in the code and the comment above. For me you already have introduced the possibility of I wondered what we would want to do with a I presume you mean you will later change the code in init to use getters/setters to Maybe just convert the |
|
what about just putting the setter in place right now? as you said
|
|
Okay, perhaps with a |
|
Now with a setter called at |
|
Nice, I will give it a quick test locally and merge 😄. Then I will work on improving the tool searching strategy using MEP27 (and then I think I can merge #2 directly into the main branch :). So will you do a PR for examples? I don't mind if you don't, I just want to know if you will do it. Thanks :) |
|
I want to work on the examples, but I don't know if I'll have the time today or tomorrow |
|
Okay, great, it just gives me one less thing to think about. |
FigureManager manages the Figure and not the Canvas, pt2
Adding figure attribute (property and setter)
Keeping a canvas property for pyplot stuff that uses direct acces to
figuremanager.canvas, this could be easily removed within pyplot