r/JupyterNotebooks • u/brandon_belkin • 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
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
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.