using PlotlyJS, FileIO, Base64
The WebIO Jupyter extension was not detected. See the WebIO Jupyter integration documentation for more information.
Create a plot:
n=255
I = [i for i in 0:n, j in 0:n]
width=400; height=375
plt=Plot(heatmap(z=mod.(xor.(I, I'), 53), colorscale=colors.algae, showscale=false ),
Layout(width=width, height=height, yaxis_autorange="reverse"))
io = IOBuffer()
PlotlyJS.savefig(io, plt; width=width, height=height, scale=1, format="png")
bytes = take!(io)
bs64_string= "data:image/png;base64,$(stringmime(MIME("image/png"), bytes))"
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAF3CAYAAACL/h32AAAgAElEQVR4XuydB5iVxfX/Z/fe3aUtHZRuh2gCWMGKSkQxFixAbKBGEHuwFww/Yo+F2LHEglEDNtTEgsEaWzR2DXaxhyqd3b27+3++Z94z97xnZvcui3+T3WfmeXzA9zD3vnNm5r7vzJnv+RTV1tbWmliiB6IHogeiB6IH1tIDRfEBspYei/88eiB6IHogeoA8EB8gcSB" ⋯ 121868 bytes ⋯ "9kHtgzXggf4CsGb/mn5p7IPdA7oGq90D+AKn6Ic47mHsg90DugTXjgfwBsmb8mn9q7oHcA7kHqt4D+QOk6oc472DugdwDuQfWjAfyB8ia8Wv+qbkHcg/kHqh6D+QPkKof4ryDuQdyD+QeWDMeyB8ga8av+afmHsg9kHug6j2QP0CqfojzDuYeyD2Qe2DNeCB/gKwZv+afmnsg90Dugar3QP4AqfohzjuYeyD3QO6BNeOB/wfUo8juGL0LrgAAAABJRU5ErkJggg=="
#Display image from the bs64 string
Plot(PlotlyJS.image(; source=bs64_string, hoverinfo="none"),
Layout(xaxis_visible=false, yaxis_visible=false))