You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Can you kindly consider adding an option to set the opacity of legend markers? Currently, the opacities of the legend's markers are tied to the opacity values of the traces.
Plotly Version
plotly.js v2.35.2
Some scatter plots use a very low opacity (<0.10) to display the concentration of overlapping data points.
👇 This can result in imperceptible marker colors in the legend, as shown below:
👇 Feature request: add an option to set the legend marker opacity
I used a workaround to manually set the opacity of the scatterpts class using CSS.
/* current workaround */
.legendpoints .scatterpts {
opacity:1!important;
}
In below, the legend marker's opacity will not using the opacity value from marker.opacity (defined in data) but from legend.opacity (defined in layout)
layout = {
legend: {
opacity: 1
}
}
but I wonder if we need to be more specific, e.g., put the opacity option inside the marker (or other name)
layout = {
legend: {
marker: {
opacity: 1
}
}
}
Or should it not be within layout, but be inside data for each individual trace (But I guess that would be more complex)?
I need more thoughts/advice from more people (especially the Plotly team) so I can further implement it as there are other types of charts that will use the legend. Currently I'm only focusing on scatter plots and bar charts (and histograms).
Can you kindly consider adding an option to set the opacity of legend markers? Currently, the opacities of the legend's markers are tied to the
opacity
values of the traces.Plotly Version
plotly.js v2.35.2
Some scatter plots use a very low opacity (<0.10) to display the concentration of overlapping data points.
👇 This can result in imperceptible marker colors in the legend, as shown below:
👇 Feature request: add an option to set the legend marker opacity
I used a workaround to manually set the opacity of the
scatterpts
class using CSS.👇 CodePen for Testing
Related posts:
Thank you for maintaining one of the best DataViz libraries! 👍
The text was updated successfully, but these errors were encountered: