Open Time0o opened 5 years ago
I also meet this annoying issue. I find no way to reveal them on the notebook, but I find a compromise way to display them on an html page that is File -> Print Preview.
I think I finally figured this out or at least got it working in my situation. I believe Jupyter is sanitizing the SVG/HTML.
The "fix" is just to select "Trust Notebook" in the File menu. This will cause the page to reload and all the SVGs will now be displayed. I should add that you should only do this for a notebook you know is safe to trust.
@harper357 , thank you for this hint - this simplifies my life quite a bit!
The "fix" is just to select "Trust Notebook" in the File menu. This will cause the page to reload and all the SVGs will now be displayed. I should add that you should only do this for a notebook you know is safe to trust.
What can I do if there is no such "Trust" option? I created the notebook myself completely but the SVG inline output still disappears upon page reload. That's a quite annoying bug...
It was removed from the File menu a little while back. It should be in the Console sidebar though.
I have now observed this multiple times yet it is impossible to reproduce because it only happens for some of my notebooks, seemingly arbitrarily: when I produce Matplotlib plots in a Jupyter notebook using
%matplotlib inline
andplt.show
they are displayed correctly, but in some cases shutting down the notebook server, restarting it and then reopening the notebook causes the plots to be replaced by placeholders of the form<Figure size 288x864 with 3 Axes>
.This only seems to happen when I use
set_matplotlib_formats('svg')
(which I imagine is a common setting) and as mentioned not for every notebook (but for all images in a notebook if it does happen).I'm using anaconda,
jupyter --version
is4.4.0,
jupyter notebook --versionis
5.4.0,python --version
is3.6.8
andmatplotlib.__version__
is'2.2.3'
. This happens for both Chrome and FirefoxThis essentially makes Jupyter unuseable for me so I was surprised that I could not find an issue bringing this up. Is this a known issue? Or maybe even intended? Or am I doing something wrong here?
I'll attach the saved output of a cell which should display an SVG image but doesn't (I can't share the whole notebook and as I mentioned I can't seem to produce a minimal example).
``` { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "data": { "image/svg+xml": [ "\n", "\n", "\n", "\n" ], "text/plain": [ "