r/JupyterNotebooks Jan 08 '24

are jupyter plot just image?

I'm writing a Jupyter Notebook for a lab report template school project. The idea is to share the template with the students, and have good reports back. I'm quite new on Jupyter, sorry for the newbie question ... Once I create a plot (using matplotlib for example) I get it as an IMAGE in the notebook. I can't pan,zoom in-out, I can't have a cursor in the plot. Am I'm missing something or this is it? Is there a way to have an "iteractive" plot as output?

Thanks

2 Upvotes

6 comments sorted by

3

u/ericsnekbytes Jan 10 '24 edited Jan 10 '24

Some plotting libraries output their plots as images, others as interactive HTML/Javascript. I believe matplotlib has some features for interactivity, explained here. As u/yngwi noted, plotly is another popular plotting library with interactive plots. Many libraries have features that allow them to integrate with Jupyter (so it can display your plots), ipython or other tools, if you'd like to learn more about the features that make this integration possible in matplotlib, you can read here.

1

u/brandon_belkin Jan 10 '24

Thanks so much, I will try to investigate matplotlib option.

2

u/ericsnekbytes Jan 11 '24

There are a TON of people in the Jupyter community (on the discourse forums for example) who would be happy to help you along your journey, so please reach out if you're ever in need of help! It's a big worldwide group of contributors and users so it takes a little time to get responses sometimes, but you're among friends in the Jupyter community :) BTW, there are weekly open meetings for all to join where you can ask core developers questions, share your projects etc, if you'd like to attend. You can message me here as well if you'd like, for questions or extra info. Cheers!

3

u/yngwi Jan 09 '24

You can use something like Plotly.

1

u/brandon_belkin Jan 10 '24

Thanks so much, I've just had some preliminary tests, but that's what I was looking for.

2

u/yngwi Jan 10 '24

You're welcome