I wanted to use matplotlib in colab but it didn't work. As this link says I tried both %matplotlib inline
and %matplotlib notebook
but they both didn't work. But can I ask why this link plots are working well? It seems it's just using normal matplotlib with %matplotlib inline
. I want to know the difference.
According to colab
docs:
In the IPython notebook, you also have the option of embedding graphics directly in the notebook, with two possible options:
%matplotlib notebook
will lead to interactive plots embedded within the notebook.
%matplotlib inline
will lead to static images of your plot embedded in the notebook.
Plotting from an IPython notebook
The IPython notebook is a browser-based interactive data analysis tool that can combine narrative, code, graphics, HTML elements, and much more into a single executable document.
Plotting interactively within an IPython notebook can be done with the %matplotlib command, and works in a similar way to the IPython shell. In the IPython notebook, you also have the option of embedding graphics directly in the notebook, with two possible options:
%matplotlib notebook
will lead to interactive plots embedded within the notebook
%matplotlib inline
will lead to static images of your plot embedded in the notebook
Selecting a GPU from the hardware accelaration tab solved the issue for me.
Go into Edit > Notebook Settings > Select GPU in the drop-down.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With