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 segment-specific radius and inner_radius for pie #4028

Merged
merged 21 commits into from
Aug 29, 2024

Conversation

ctarn
Copy link
Contributor

@ctarn ctarn commented Jul 13, 2024

This PR is based on #4027, and thus please don't merge it before #4027 is finished. [Update: Done]

I extend the radius and inner_radius of pie so that we now can easily plot the following figure:

import Makie, CairoMakie

fig = Makie.Figure()
ax = Makie.Axis(fig[1, 1]; autolimitaspect=1)

kw = (; offset_radius=0.4, strokecolor=:transparent, strokewidth=0)
Makie.pie!(ax, ones(7); radius=sqrt.(2:8) * 3, kw..., color=Makie.wong_colors(0.8)[1:7])

vs = [2, 3, 4, 5, 6, 7, 8]
vs_inner = [1, 1, 1, 1, 2, 2, 2]
rs = 8
rs_inner = sqrt.(vs_inner ./ vs) * rs

lp = Makie.LinePattern(; direction=Makie.Vec2f(1, -1), width=2, tilesize=(12, 12), linecolor=:darkgrey, background_color=:transparent)
# draw the inner pie twice since `color` can not be vector of `LinePattern` currently
Makie.pie!(ax, 20, 0, vs; radius=rs_inner, inner_radius=0, kw..., color=Makie.wong_colors(0.4)[eachindex(vs)])
Makie.pie!(ax, 20, 0, vs; radius=rs_inner, inner_radius=0, kw..., color=lp)
Makie.pie!(ax, 20, 0, vs; radius=rs, inner_radius=rs_inner, kw..., color=Makie.wong_colors(0.8)[eachindex(vs)])

display(fig)

pie-radius

@ctarn
Copy link
Contributor Author

ctarn commented Aug 13, 2024

PR #4027 has been finished, and the PR is ready to be reviewed.
Is there anything I can do so you don't need to copy the PR before merging? @ffreyer Thank you! Maybe transfer the fork to my personal account instead of an organization?

@ffreyer
Copy link
Collaborator

ffreyer commented Aug 13, 2024

For me there is a checkbox I can tick when I create a pr:
image
and I still have that check box to the right of the pr after opening one:
image
I guess depending on the organization security settings this might be disabled/always denied? In that case moving to a personal account to allow this would make things easier for us. Though it's not that much work to create a copy branch/pr either.

@ctarn
Copy link
Contributor Author

ctarn commented Aug 13, 2024

Yes! I have transfered the fork into my own account, and see the checkbox now. Hope it works now! Thank you!

pie!(ax, 20, 0, vs; radius=rs_inner, inner_radius=0, kw..., color=lp)
pie!(ax, 20, 0, vs; radius=rs, inner_radius=rs_inner, kw..., color=Makie.wong_colors(0.8)[eachindex(vs)])

display(fig)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is causing the test failures?

Suggested change
display(fig)
fig

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! fixed.

@ffreyer
Copy link
Collaborator

ffreyer commented Aug 29, 2024

Something is wrong with docs here. 360m runtime...

@ctarn
Copy link
Contributor Author

ctarn commented Aug 29, 2024

seems that similar issues appear in docs/src/reference/plots/pie.md :(
trying again

@ctarn
Copy link
Contributor Author

ctarn commented Aug 29, 2024

The test has passed. Thanks!

@ffreyer ffreyer merged commit 02ccec3 into MakieOrg:master Aug 29, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Merged
Development

Successfully merging this pull request may close these issues.

3 participants