Repository navigation
Conversation
|
Seems reasonable to me, but can you make the commit again, configuring your editor not to strip whitespace? We don't like big whitespace changes. |
|
I think the whitespace will be delt with :
+1 also on the context manager. with inline:
blahhhhMaybe it's a bad idea as it reuses the same context manager each time, but I guess you see what I mean. |
|
I don't really view |
|
So revert the whitespace changes, or not? @minrk did you want me to add that to this PR? |
|
@adrn I might be alone in thinking that pylabtools isn't a place for public APIs, so let's wait to hear from someone else before making you do more stuff. We always appreciate avoiding / removing whitespace changes if you are comfortable with the |
|
It contains bits that are meant to be public, like select_figure_formats, and bits that probably aren't. I think it makes sense to have a public module separate from |
|
select_figure_formats isn't public, the public API for that is Should we add |
|
Ah, OK, I didn't know (/had forgotten) that distinction. My inclination would be to put a module for this under |
|
Pulled out the whitespace changes |
|
Marked needs decision for the API question: do we want a separate module for public API around mpl integration? Also, naming question - to me, use_backend seems a bit too generic for something that temporarily switches backend and then switches back. Maybe temp_backend? |
For the records (as I might not be here for the decision hangout):
And one last question, should check that |
|
|
After testing, this doesn't seem to work. When I use a GUI backend, it draws briefly and is dismissed. When I use inline temporarily, it just never draws. I think temporarily enabling a backend is significantly more complex than this suggests, because a lot of mpl events happen asynchronously, or in the post_execute hook, and thus after the context manager |
|
Closing this one as stale. If you want to pick it up again and try to work out the tricky async bits, feel free to open a new PR. |
I'm often in the situation where most of the plots in my notebook are fine as static pngs (with
inline), but it would be nice to interact with some (e.g., change view angle on 3D plots). Thenbaggbackend is nice, but a bit slow for interacting with some figures. I thought it would be nice to have a context manager that allowed code in a given cell to use a different backend.This is a very simple implementation of something what works on my machine. Let me know if I overlooked something. Will add tests, but first want to make sure this simple approach is ok...
Also, curse my white-space nuker...