One easy way to display image on a Jupyter notebook is using HTML chunk of code in a Markdown cell
, here is an example:
<img src='./image/filename.png'>Image description</img>
Your image has the file extension .svg. Datacamp.com's system doesn't like SVG images for some reason. Find the image in JPG or PNG format, or convert it to one of those formats using a free online tool like this one.,Your embedding code is incorrect. Please use Markdown image syntax or HTML image syntax. Many instructors find HTML tags easier to implement. The image you are using will need to be saved in the project repository's img folder in order to be access from datacamp.com.,If your images aren't loading correctly in the Jupyter Notebook locally or on datacamp.com (as accessed through your Teach dashboard), it is likely due to one or both of the following reasons:,Your embedding code is incorrect. Please use Markdown image syntax or HTML image syntax. Many instructors find HTML tags easier to implement. The image you are using will need to be saved in the project repository's img folder in order to be access from datacamp.com.For HTML image syntax, you may wish to right-justify the image like this:
Your image has the file extension .svg. Datacamp.com's system doesn't like SVG images for some reason. Find the image in JPG or PNG format, or convert it to one of those formats using a free online tool like this one.
Your embedding code is incorrect. Please use Markdown image syntax or HTML image syntax. Many instructors find HTML tags easier to implement. The image you are using will need to be saved in the project repository's
img
folder in order to be access from datacamp.com.For HTML image syntax, you may wish to right-justify the image like this:
<img src="img/blood_donation.png" style="float: right;" alt="A pictogram of a blood bag with blood donation written in it" width="200" />
The image syntax described above gives you more customizability, but note that this syntax will not show the image in common Markdown viewers (for example when the files are viewed on GitHub).,Markdown figures combine colon style admonitions and HTML image parsing, to produce a “Markdown friendly” syntax for figures, with equivalent behaviour to the figure directive above.,This will correctly copy the image to the build folder and will render it in all output formats (HTML, TeX, etc). However, it is limited in the configuration that can be applied. For example, the image width cannot be set with this syntax.,Allowed attributes are equivalent to the image directive: src, alt, class, width and height. Any other attributes will be ignored.

``
`{image} ../images/fun-fish.png
:alt: fishy
:class: bg-primary mb-1
:width: 200px
:align: center
`
``
parse: myst_enable_extensions: # don 't forget to list any other extensions you want enabled, # including those that are enabled by default ! -html_image
<img src="../images/fun-fish.png" alt="fishy" class="bg-primary" width="200px">
<img src="../images/fun-fish.*" alt="fishy" class="bg-primary mb-1" width="200px">
``
`{figure} ../images/C-3PO_droid.png
---
height: 150px
name: directive-fig
---
Here is my figure caption!
`
``
By rendering the figure to a static image file using Kaleido such as PNG, JPEG, SVG, PDF or EPS and loading the resulting file in any viewer,Displaying Figures using Plotly's Python graphing library ,Plotly's Python graphing library, plotly.py, gives you a wide range of options for how and where to display your figures.,Interactive renderers display figures using the plotly.js JavaScript library and are fully interactive, supporting pan, zoom, hover tooltips, etc.
import plotly.graph_objects as go
fig = go.Figure(
data = [go.Bar(y = [2, 1, 3])],
layout_title_text = "A Figure Displayed with fig.show()"
)
fig.show()
import plotly.graph_objects as go
fig = go.Figure(
data = [go.Bar(y = [2, 1, 3])],
layout_title_text = "A Figure Displaying Itself"
)
fig
import plotly.io as pio
pio.renderers
Renderers configuration
-- -- -- -- -- -- -- -- -- -- -- -
Default renderer: 'notebook_connected'
Available renderers: ['plotly_mimetype', 'jupyterlab', 'nteract', 'vscode',
'notebook', 'notebook_connected', 'kaggle', 'azure', 'colab',
'cocalc', 'databricks', 'json', 'png', 'jpeg', 'jpg', 'svg',
'pdf', 'browser', 'firefox', 'chrome', 'chromium', 'iframe',
'iframe_connected', 'sphinx_gallery', 'sphinx_gallery_png'
]
import plotly.io as pio
pio.renderers.default = "browser"
import plotly.graph_objects as go
fig = go.Figure(
data = [go.Bar(y = [2, 1, 3])],
layout_title_text = "A Figure Displayed with the 'svg' Renderer"
)
fig.show(renderer = "svg")
JupyterLab provides a unified architecture for viewing and editing data in a wide variety of formats. This model applies whether the data is in a file or is provided by a kernel as rich cell output in a notebook or code console.,File extensions: .bmp, .gif, .jpeg, .jpg, .png, .svg,As with other files in JupyterLab, multiple views of a single file remain synchronized, enabling you to interactively edit and render Vega/Vega-Lite visualizations:,JavaScript Object Notation (JSON) files are common in data science. JupyterLab supports displaying JSON data in cell output or viewing a JSON file using a searchable tree view:
from IPython.display import display, HTML
display(HTML('<h1>Hello World</h1>'))
from IPython.display import display
display({'text/html': '<h1>Hello World</h1>', 'text/plain': 'Hello World'}, raw=True)