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

Add support for interactive mode on Matplotlib #1469

Merged
merged 4 commits into from
Jul 8, 2020
Merged

Add support for interactive mode on Matplotlib #1469

merged 4 commits into from
Jul 8, 2020

Conversation

philippjfr
Copy link
Member

Adds support for interactive Matplotlib plots based on ipympl.

Screen Shot 2020-07-08 at 7 05 52 PM

@codecov
Copy link

codecov bot commented Jul 8, 2020

Codecov Report

Merging #1469 into master will decrease coverage by 0.70%.
The diff coverage is 40.84%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1469      +/-   ##
==========================================
- Coverage   86.44%   85.74%   -0.71%     
==========================================
  Files         138      138              
  Lines       15361    15618     +257     
==========================================
+ Hits        13279    13391     +112     
- Misses       2082     2227     +145     
Impacted Files Coverage Δ
setup.py 0.00% <ø> (ø)
panel/pane/ipywidget.py 45.71% <18.18%> (-1.17%) ⬇️
panel/pane/plot.py 54.33% <29.78%> (-9.45%) ⬇️
panel/io/notebook.py 58.64% <100.00%> (ø)
panel/pane/ace.py 90.90% <100.00%> (ø)
panel/pane/base.py 89.55% <100.00%> (ø)
panel/pane/deckgl.py 73.52% <100.00%> (ø)
panel/pane/markup.py 97.07% <100.00%> (ø)
panel/pane/plotly.py 88.88% <100.00%> (ø)
panel/pane/vega.py 79.50% <100.00%> (ø)
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d8804e5...9256a07. Read the comment docs.

@philippjfr philippjfr merged commit 49c9ecf into master Jul 8, 2020
@philippjfr philippjfr deleted the ipympl branch July 8, 2020 18:17
@MarcSkovMadsen
Copy link
Collaborator

MarcSkovMadsen commented Jul 9, 2020

I thought the ipywidgets where costly to load and as such native bokeh/ panel implementations where preferred?

@jbednar
Copy link
Member

jbednar commented Jul 9, 2020

Sure, but there are plenty of plots available from Matplotlib not available anywhere else, plus some people just prefer Matplotlib. Panel has no opinion about what plotting library you use, though of course each one comes with tradeoffs...

@philippjfr
Copy link
Member Author

Also this is entirely optional, I'm just giving users access to this capability.

@MarcSkovMadsen
Copy link
Collaborator

Its not that i dont like. I do. I’m just trying to understand when a native implementation is required and when ipywidgets version Can be used.

There Probably are a lot of things that Can be done via ipywidgets.

Ivuetify for example.

Would it be ok to give users easy access to these in Panel via Param or would it be something you can do but really should not do? Instead bokeh models should be built?

@jbednar
Copy link
Member

jbednar commented Jul 9, 2020

Sure. I'd say that there is a large class of things that can very easily be made available to Panel users in some usable form. Some of those could be made much more performant if someone wants to invest time and energy into them, but if even the easily obtained version is already usable in many cases, why not? I'd only invest in making a highly optimized special version if it's really needed; in the meantime it's great that more things just work!

philippjfr added a commit that referenced this pull request Sep 17, 2020
* Add support for interactive mode on Matplotlib

* Minor fixes

* Add ipympl

* Fix for pn.ipywidget
@mcrees
Copy link

mcrees commented May 4, 2021

Hi,
I have been experiencing issues with interactive Matplotlib panes.

First - the interactive options are not displaying properly. All the functionality is working but the icons are not displaying correctly:
image

Second - Sizing to fit spaces does not seem to function well with interactive mode. When interactive mode is False, sizing works as expected (scaling or stretching).

I'm using PyCharm, files are .py & panel v 0.11.3

Not sure if this is the best place to post.
Thanks for the good work

@jbednar
Copy link
Member

jbednar commented May 4, 2021

So that we can keep track of to-do items, please open two separate issues, each listing the relevant software versions and describing that specific problem. Comments on closed or merged PRs are very likely to get overlooked!

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.

4 participants