RecipesBase.jl icon indicating copy to clipboard operation
RecipesBase.jl copied to clipboard

[bug] Repeat keyword arguments for Type recipes

Open gustaphe opened this issue 3 years ago • 0 comments

I think this is a bug:

struct VisibilityVector
    x::Vector{Float64}
end

@recipe function f(::Type{VisibilityVector}, x::VisibilityVector; mysize=14)
    tickfontsize:=mysize # The default is 8pt, so this type has large tick labels by default
    x.x
end

x = VisibilityVector(1:5)
y = 1:5

plot(x,y) # Correctly puts large tick labels on the x axis
plot(x,y;mysize=8) # Correctly puts small tick labels on both axes
plot(y,x) # Correctly puts large tick labels on the y axis
plot(y,x;mysize=8) # Correctly puts small tick labels on both axes
plot(x,x) # Correctly puts large tick labels on both axes


plot(x,x;mysize=8) # *In*correctly puts large tick labels on the y axis

VisibilityVector

I use font size for illustration here, but it goes for anything: The custom keyword arguments are only applied as given on the first encountered axis, and as the default on successive ones.

gustaphe avatar Mar 03 '21 17:03 gustaphe