JetBrains / lets-plot

Multiplatform plotting library based on the Grammar of Graphics
https://lets-plot.org
MIT License
1.5k stars 47 forks source link

Is there a way to customize plot background (all the background) in JVM? #485

Closed vlsi closed 2 years ago

vlsi commented 2 years ago

I see BACKDROP_COLOR = "white", however I do not see the way to customize it via themes.

https://github.com/JetBrains/lets-plot/blob/422d3081ee0ca2a958ea0c1ae1a527cbb2ce825d/plot-builder-portable/src/commonMain/kotlin/jetbrains/datalore/plot/builder/presentation/Defaults.kt#L32

I want to make the chart look well for themes like https://github.com/weisJ/darklaf#screenshots, and it looks like the white background for dark themes is not suitable.

Is there a way to adjust the background?

alshan commented 2 years ago

At the moment there is no way to do that. ggplot2 theme has plot.background parameter which we are missing. I'll take a look.

alshan commented 2 years ago

Hi, in 3.1.1 I've aded plotBackground, legendBackground theme parameters (both - elemRectangle). This should allow you to configure plot themes matching darklaf.