Kolaru
June 25, 2021, 1:59pm
1
Looking at the documentation I can not found what are the available line styles for plotting lines. I only found :dashed
in one example.
Having a list somewhere or, if it already exists and I missed it, a link to it in the documentation of lines
would be helpful.
2 Likes
jules
June 25, 2021, 3:17pm
2
It’s dash, dot, dashdot and dashdotdot I think. We should add examples on the lines page. And you can pass an array of relative segment and gap lengths as well.
1 Like
You can have a look at the convert functions:
end
Palette(name::Union{String, Symbol}, n = 8) = Palette(categorical_colors(name, n))
function to_color(p::Palette)
N = length(p.colors)
p.i[] = p.i[] == N ? 1 : p.i[] + 1
return p.colors[p.i[]]
end
to_color(c::Nothing) = c # for when color is not used
to_color(c::Number) = Float32(c)
to_color(c::Colorant) = convert(RGBA{Float32}, c)
to_color(c::Symbol) = to_color(string(c))
to_color(c::String) = parse(RGBA{Float32}, c)
to_color(c::AbstractArray) = to_color.(c)
to_color(c::AbstractArray{<: Colorant, N}) where N = convert(Array{RGBAf, N}, c)
to_color(p::AbstractPattern) = p
function to_color(c::Tuple{<: Any, <: Number})
col = to_color(c[1])
return RGBAf(Colors.color(col), alpha(col) * c[2])
end
This file has been truncated. show original
Hi All,
I guess the Legend(…) is also supposed to work with this custom (vector) linestyles, the same way it does with :dash, :dot. It is not working in my case. Could you confirm that? If so, I will try to debug and build a minimum working example.
Thanks
jules
July 6, 2022, 5:26am
5
Is this maybe the same problem as in this issue? Legend dash and dashdot · Issue #1908 · JuliaPlots/Makie.jl · GitHub
Then you need to increase the Legend patchsize