Skip to main content
6 of 7
edited tags
kglr
  • 400.5k
  • 18
  • 488
  • 929

Regarding SwatchLegend and ColorFunction

Can I use ColorFunction in place of color in SwatchLegend or is there any way to include ColorFunction in SwatchLegend?

For example, the command

SwatchLegend[{Directive[{"Rainbow", Opacity[0.25]}]},
  {Text[Style["f1", FontFamily -> "Times New Roman", 18, Red]]}]

shows only gray color.