1

In Jupyter Notebook I can use the following:

import ipywidgets as widgets

file = open("./image.png", "rb")
image = file.read()
widgets.Image(
    value=image,
    format='png',
    width=700,
    height=100,
)

This doesn't work in Jupyter Lab though, what is the Jupyter Lab version of the above?

3

1 Answer 1

4

A very simple solution would be, via Markdown :-)

you can do it directly in a markdown cell:

![title](./image.png)

or via a python cell:

from IPython.display import HTML, display, Markdown, Latex
display(Markdown("![title](./image.png)")

or via a markdown cell:

<img src="./image.png" style="height: 300px;"/>

Or via a python cell:

display(Markdown('<img src="image.png" style="height: 300px;"/>'))
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.