-
Notifications
You must be signed in to change notification settings - Fork 224
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
ipympl for matplotlib not created through pyplot #221
Comments
This looks more like SageMath is producing nonstandard (?) matplotlib figures. Check the source code to see how matplotlib is initialised in SageMath. Particularly through the |
Thanks for the feedback. This could well be; and in fact be ideal for me as the solution would Nevertheless,it would be helpful to have an example of a widget produced from a matplotlib figure not produced with pyplot1 |
We are not too far, though:
gives out expected result .. |
And yet, if we do
nothing appears |
We are not too far, though:
```
fig = plot(sin).matplotlib();
from ipympl.backend_nbagg import new_figure_manager_given_figure
new_figure_manager_given_figure(1,fig)
```
gives out expected result ..
Ah ah! Well done! I had tried something along these lines and failed.
So now the next step is to try it out on a variety of Sage plots to
check the robustness.
|
Should work well with 2D plots. |
It works but doesn't look like a recommended way to do this, as I want to use a library that creates matplotlib figures with |
Is it possible to use ipympl starting from an arbitrary matplotlib figure? If yes, an example would be helpful. Thanks!
Use Case: I would like to use ipympl for SageMath plots. The later do have a method to
convert them to matplotlib figure. However the figure has not been created with the usual
pyplot workflow, and does not have a canvas setup.
In a jupyter notebook with the SageMath kernel (e.g. using the binder link from https://github.com/sagemath/sage-binder-env/ after installing ipympl with
sage -pip install ipyml
)It could well be that SageMath is producing weird matplotlib figures though.
cc: @zerline
The text was updated successfully, but these errors were encountered: