0

In an Jupyter notebook markdown cell I evaluate

<img src="mypic.png">

which displays the pic in the notebook. 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). What's the problem here and how do I solve it?

MaxPowers
  • 5,235
  • 2
  • 44
  • 69
  • 1
    The image is being cached by your browser. One way to avoid it is to use `IPython.display.Image('mypic.png')` - this will read it from disk and send the data to the browser to display. It will mean that the notebook file includes a copy of the image, however. – Thomas K Oct 17 '16 at 13:13

1 Answers1

0
from IPython.display import Image
Image(filename="mypic.png")

Learned this here

Note that this does not display the image inside a loop and your markdown cell must become a code cell

Community
  • 1
  • 1
CodingYourLife
  • 7,172
  • 5
  • 55
  • 69