for plots with background Image(s) (f.e. plotrobertson chart). Attach pictures directly to the plotly figure rather than accessing it via a local filepath. That way plots can be uploaded to online libraries (f.e. Chart Studio etc.) and are in general less dependant.
Solution proposal:
opening the image as a PIL.Image.Image object (this requires the pillow package) and passing that image object as the image source property. This will convert the image into a base64 encoded string and embed it in the figure so that it no longer depends on the file on the filesystem.
greyed out original code vs. suggested code below:
note that the package dependency needs to be amended
for plots with background Image(s) (f.e. plotrobertson chart). Attach pictures directly to the plotly figure rather than accessing it via a local filepath. That way plots can be uploaded to online libraries (f.e. Chart Studio etc.) and are in general less dependant. Solution proposal: opening the image as a PIL.Image.Image object (this requires the pillow package) and passing that image object as the image source property. This will convert the image into a base64 encoded string and embed it in the figure so that it no longer depends on the file on the filesystem. greyed out original code vs. suggested code below: note that the package dependency needs to be amended