import polars as pl
from pyobsplot import Obsplot, Plot, d3, js
= pl.read_csv("data/stocks.csv", try_parse_dates=True)
stocks
Plot.plot(
{"y": {"grid": True},
"color": {"legend": True},
"marks": [
Plot.lineY("x": "Date", "y": "Close", "stroke": "Symbol", "tip": True}
stocks, {
)
],
},="light"
theme )
Themes
When using a plot generator object, it is possible to specify one of three output themes: light
, dark
and current
.
light
theme
The light theme produces plots with a white background and a black foreground color. This is the default theme:
dark
theme
The dark theme produces plots with a black background and a white foreground color.
Plot.plot(
{"y": {"grid": True},
"color": {"legend": True},
"marks": [
Plot.lineY("x": "Date", "y": "Close", "stroke": "Symbol", "tip": True}
stocks, {
)
],
},="dark"
theme )
current
theme
The “current” theme uses a transparent background and a currentColor
foreground, so it should keep the current color theme:
Plot.plot(
{"y": {"grid": True},
"color": {"legend": True},
"marks": [
Plot.lineY("x": "Date", "y": "Close", "stroke": "Symbol", "tip": True}
stocks, {
)
],
},="current"
theme )