Skip to content

Unable to change legend linewidth and markersize with theme #737

Description

@stelmo

Bug description

The linewidth and markersize attributes from Legend in a theme are not transfered to a plot. Something is going wrong here it seems (from Makie slack with @jkrumbiegel):

function _get(plottype, scale_args, attributes, key, fallback)
return get(scale_args, key) do
get(attributes, key) do
to_value(get(Makie.default_theme(nothing, plottype), key, fallback))
end
end
end

Steps to reproduce

Here is a MWE:

using CairoMakie, AlgebraOfGraphics, DataFrames

update_theme!(Legend = (linewidth=20,markersize=20,), Lines = (linewidth=20,), Scatter = (markersize=20,),)
df = DataFrame(X = [1,2,3,1,2,3], Y = [1,2,3,1,2,3], Grp = ["A", "A", "A", "B", "B", "B"])

data(df) * mapping(:X, :Y, color = :Grp) * visual(Lines) |> draw
data(df) * mapping(:X, :Y, color = :Grp) * visual(Scatter) |> draw

Images

In both these images, the legend marker size and line width are too small.

Image Image

Version info

  • Makie v0.24.9
  • CairoMakie v0.15.9
  • AlgebraOfGraphics v0.12.4
  • Julia Version 1.12.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions