Hi,
I am trying to plot a bar chart with some employee data, but instead of having employee names on the x-axis, I would like to include a small thumbnail of their photo.
I have tried to use the ‘images’ attribute in my custom layout, but I get this error:
PlotlyDictKeyError: 'images' is not allowed in 'layout' Path To Error: ['images'] Valid attributes for 'layout' at path [] under parents []: ['orientation', 'paper_bgcolor', 'scene', 'height', 'radialaxis', 'titlefont', 'hovermode', 'font', 'boxmode', 'showlegend', 'title', 'plot_bgcolor', 'dragmode', 'smith', 'width', 'bargap', 'xaxis', 'bargroupgap', 'hidesources', 'direction', 'hiddenlabelssrc', 'autosize', 'separators', 'hiddenlabels', 'barmode', 'boxgap', 'angularaxis', 'geo', 'legend', 'yaxis', 'annotations', 'shapes', 'barnorm', 'boxgroupgap', 'margin'] Run
.help(‘attribute’)on any of the above. '<layout-object>' is the object at []
plotly.version returns 1.12.9 - is the images feature too new for this version?
My second question is whether this is even the best approach to use to achieve what I want to do. Is there an easier way to replace all axis labels with images? I am currently doing something like:
images = []
for i in enumerate(data)
...
images.append(dict(source=data[i].image_url,
xref='x',
yref='paper',
x=i,
y=0,
sizex=1,
sizey=1,
xanchor='center',
yanchor='middle'))
layout = go.Layout(images=images) <--------- The error is thrown here
...
Thanks for your help,
Norbert