Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to set line join and cap in CairoMakie #871

Closed
devmotion opened this issue Mar 11, 2021 · 2 comments
Closed

Allow to set line join and cap in CairoMakie #871

devmotion opened this issue Mar 11, 2021 · 2 comments

Comments

@devmotion
Copy link
Contributor

It would be nice to be able to use a different line join style (Cairo.CAIRO_LINE_JOIN_BEVEL instead of the default Cairo.CAIRO_LINE_JOIN_MITER) with CairoMakie, and possibly also a different line cap.

This can be useful to avoid visually irritating and seemingly incorrect values: when I plotted a stochastic trajectory that is constrained to the domain [0, 1] I ended up with a plot that seemed to contain negative values. The same did not happen in a scatter plot, and after a while I realized that it was caused by the default line join. For my application I reimplemented https://github.com/JuliaPlots/CairoMakie.jl/blob/c54dd87ec687deed1e8bca2a0faf702cbb46be38/src/infrastructure.jl#L278-L286 and added Cairo.set_line_join(screen.context, Cairo.CAIRO_LINE_JOIN_BEVEL) before https://github.com/JuliaPlots/CairoMakie.jl/blob/c54dd87ec687deed1e8bca2a0faf702cbb46be38/src/infrastructure.jl#L283, but it would be nice if this could be set by a user more generally. Probably this should be done differently since I assume sometimes one might even want to use different settings for different line plots in the same figure.

@jkrumbiegel
Copy link
Member

yeah this would be good, GLMakie doesn't have other line joins that's why it's not in AbstractPlotting and also not in CairoMakie. But I think we could add it to AbstractPlotting with the caveat that it will not have an effect on anything but CairoMakie, I guess. cc @SimonDanisch

@ffreyer
Copy link
Collaborator

ffreyer commented May 24, 2024

Implemented by #3771 in Makie 0.21

@ffreyer ffreyer closed this as completed May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants