Search code examples
pythonplotly

Add image in a plotly plot from numpy array (python)


I'm trying to add an image to a fixed position in a plotly figure; however, the only way i've been able to find so far is using add_layout_image, but i don't really think it's a very practical way, since the source of the image must be an url (it's basically meant for dash apps).

Is there any simple way to embed an image, from, let's say.. a numpy array in a fixed position in a plotly fig?


Solution

  • Thanks for the answers, i nailed it using add_layout_image() and using the image converted into a PIL image from the np array.