Legend of image trace is not displayed


Let me ask this question as it seems that a similar question has been asked in the past but not answered.

Not able to add images as an item on legend - plotly.js - Plotly Community Forum

Below is a simple sample on codepen.


In this example, I have 3 traces plotted, but only the image trace does not appear in legend. I think this is a very basic functionality issue, but for some reason I can’t find any information about it anywhere. Is there a solution?

I don’t believe it is possible, but I’ll let someone who’s been around longer than I have to verify this.

One thing I’ve found, which could be some food for thought, is unicode characters. Like this:

var data3 = {
  x: [0, 2, 3, 0],
  y: [0, 1, 3, 2],
  name: 'scatter \u2705',
  type: 'scatter',
  mode: 'markers',
  showlegend: true,

Update your codepen with that, and you’ll see the unicode checkmark appear in the legend.