Create a ggplot style legend using Plot | Ashish Singh | Observable
•ojs
Comments (5)
Jason J. Benedict
May 26, 2022
Hi Ashish, thanks for this wonderful tool. I wanted to check with you if it's possible to change the font of the legend?
Ashish Singh
May 26, 2022
Hi Jason. You can pass in the fontFamily key. I've updated the notebook to use that. Cheers.
Jason J. Benedict
May 26, 2022
Thanks a lot for this, Ashish. Just another minor query - do you know how I can use my own font and change the color of it as well?
Ashish Singh
May 26, 2022
You would need to add the fonts/import the css in the notebook and then use the font. For coloured text, try adding a "fill" property to Plot.textY in plotLegend(). Cheers.
Jason J. Benedict
May 27, 2022
Thanks Ashish!
Reply
Add comment
Subscribe to notifications
Observable
Sign in
Ashish Singh
11
Reply
Add comment
Subscribe to notifications
2
Create a ggplot style legend using Plot | Ashish Singh | Observable