I'm searching for most convenient way how to insert 3D graphics into ipython (Jupyter) notebook? I mean some simple 3D model of machines (space-crafts in my case) mostly composed of simple primitives e.g. like CAD. What I want: people who read the notebook can interactively rotate the model
If I replace the file mypic.png and evaluate the above command again, the displayed image remains the old. The same happens if include the picture using markdown, like. ! [mypic] (mypic.png) To change the displayed image I have to either restart the kernel or change the filename and include the pic with new filename, like ! [mypic (mypic_.png) .
Run that cell. After that is done running, you should see the obtained file demo_notebook.ipynb listed in the file navigation panel on the left. Double-click that file name and you can now run the cells in the notebook. A few cells are set up to purposefully trigger errors, and so you cannot just Run all. By the way, if the other notebook was
url. url to load image from. requests.get. loads data from given url. Image.open. open given image with Pillow. BytesIO. convert given argument to BytesIO object, so it can be used by Pillow. response.content. get content previously loaded from url.show() displays resulting image
1. The solution above works (UBUNDU). You just have to bare in mind a few thinks: 1st: If you use jupyter notebook you need to craete this file jupyter notebook --generate-config and look for the line c.NotebookApp.use_redirect_file = True . If you use jupyter-lab (as I do) you need to use this command jupyter-lab --generate-config .
. 201 305 75 198 243 33 235 422

jupyter notebook display image from url