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

Add `strokecolor` and `strokewidth` attributes to `lines`

Open fbanning opened this issue 3 years ago • 3 comments

I'd like to plot a line with an outline to it, similar to something like this:

# wide lines for better visibility
julia> lines(1:2, linewidth=10) 

julia> lines!(1:2, linewidth=5)

Screenshot_20220117_145120

Wrapping this in a recipe with the additional kwargs for convenience and private use is simple enough. But I think it might be nice to extend the interface of the lines primitive and have two additional default attributes: strokewidth and strokecolor. Similar to how it's possible with scatter as well.

What do you think, would this be a reasonable thing to add to the lines primitive?

fbanning avatar Jan 17 '22 13:01 fbanning

I think it is. Stroke (and also glow) should be something that we can implement more efficiently in shaders in GLMakie.

ffreyer avatar Jan 17 '22 17:01 ffreyer

Cool, nice to hear that. I don't have any experience with GLMakie or shaders in general so it's sadly nothing I can contribute to then. If there's anything I could do to help out with this (e.g. testing), please get in touch. :)

fbanning avatar Jan 18 '22 09:01 fbanning

I think it is. Stroke (and also glow) should be something that we can implement more efficiently in shaders in GLMakie.

I was looking for a glow effect for plotted lines and came across this example. It looks amazing but the code is cumbersome. Similar to scatter, attributes for glowcolor and glowwidth in lines would be nice!

thompsonmj avatar Jun 10 '22 20:06 thompsonmj