-
| 
         I am trying to figure out how to display a legend in my Plot when I've passed in a custom scale. When I do this: const p = Plot.plot({
  color: {
    legend: true,
    scheme: "Category10"
  },
  marks: [...]
);The code works fine, I see my legend. But I am creating a custom scale that I can share between several Plots in order to maintain consistent colors.. So I have this: const colorScale = Plot.scale({ color: { type: "categorical", domain: myDomain, scheme: "Category10"} });
const p = Plot.plot({
  color: colorScale,
  marks: [...]
});Since I typically pass  I tried just putting  How would I enable the legend if I'm passing in a custom scale object? Thanks in advance!  | 
  
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
| 
         Try   | 
  
Beta Was this translation helpful? Give feedback.
Try
color: {...colorScale, legend: true}.