pnezis / tucan

An Elixir plotting library on top of VegaLite
https://hexdocs.pm/tucan/Tucan.html
MIT License
175 stars 3 forks source link

Axes' title is still not visible in dark theme #21

Closed icostan closed 3 months ago

icostan commented 3 months ago

I am using latest (0.3.1 version) and it displays the title of both axes in gray, as expected.

Tucan.scatter(:iris, "petal_width", "petal_length")
|> Tucan.color_by("species")
|> Tucan.shape_by("species")

When using the dark theme axes' titles are no longer visible because the color is still gray but I would expect to be white, the same as chart's title or legend.

Tucan.scatter(:iris, "petal_width", "petal_length")
|> Tucan.color_by("species")
|> Tucan.shape_by("species")
|> Tucan.set_theme(:dark)

Where is the issue? I can see "tick_color" default option set but not sure if it does the title color switch in dark theme, we might need "title_color" option as well.

pnezis commented 3 months ago

It seems that the title color setting of the theme config is not used. I will try to debug why this happens. Meanwhile you can use something like this:

Tucan.scatter(:iris, "petal_width", "petal_length")
|> Tucan.color_by("species")
|> Tucan.shape_by("species")
|> Tucan.set_theme(:dark)
|> Tucan.Axes.put_options(:x, title_color: "red")
pnezis commented 3 months ago

The problem is that kino_vega_lite applies a default theme on all rendered plots that may override the Tucan themes settings. I disabled the theme locally and the axes titles are properly displayed:

image

Thanks for reporting this, will check what we can do.