How to enable interactive Python matplotlib figures in DataBricks?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2023 08:54 AM
I want to make a matplolib interactive (I can zoom in/out, etc.) in databricks. This is achieved in Jupyter notebook by the following code:
%matplotlib notebook
How to achieve this in databricks?
Thank you
- Labels:
-
Jupyternotebook
-
Matplotlib
-
Python
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2023 11:01 AM
Import matplotlib.pylot
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2023 12:22 PM
I wish it was that simple. "Import matplotlib.pyployt" allow you to plot but as static plots. I need an interactive plot.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2023 11:02 AM
This can help you to import and use use according to your need
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2023 10:55 PM
Hi @Elias Abou Zeid
Hope all is well! Just wanted to check in if you were able to resolve your issue and would you be happy to share the solution or mark an answer as best? Else please let us know if you need more help.
We'd love to hear from you.
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2023 10:39 AM
Hi @Elias Abou Zeid,
Did you have time to test @Kaniz Fatma recommendation? do you still need help? please let us know
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2023 10:08 AM
I have tried %matplotlib inline , it does not work the plot remains static
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2023 11:48 PM
Hi there, while facing a similar issue we switched to Altair python library and it works great with Databricks. (other options can be Bokeh or Plotly).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2023 05:40 AM
Thanks @Andrii Muzychuk. I already have a complex interactive plot function developed using matplotlib under jupyter. I imported to Databricks, but unfortunately for now I have not figured out a way to make it work interactively in DataBricks. Instead of re-writing it from scratch is there a way to convert a matplotlib figure to Altair ( I have tried plotly mpl_to_plotly but it does not work properly for my plot).?

