Displaying images as bar char x-axis labels - 'images' is not allowed in layout?


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)
layout = go.Layout(images=images)  <--------- The error is thrown here

Thanks for your help,

Just wanted to add that I’m doing this in offline mode.

Hi there,

This is a new feature, can you upgrade to the latest version of Plotly (pip install plotly --upgrade) and let me know if you’re still experiencing this issue.

Thanks for your reply.

Unfortunately I am working in a corporate environment with an Anaconda installation and don’t control the installation process of any packages, but I’m working with someone who does.

They say they need to know which pypi package can we pull the latest version from, as pip install would install 1.12.9, the version we currently have. Alternatively, we could install it from github, but we need to know which branch/tag.

As a side-note, you guys really ought to release a proper version with the correct change-log and have some kind of documentation versioning in order to avoid such problems in the future. Not every one of your users is a single developer on a single machine with root access, who can just update whenever necessary :slight_smile:

Hi! Is there an example for using images as x-axis labels? I am struggling with the snippet above. Help would be highly appreciated!