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

Respect linestyle when stroking polygons in CairoMakie #2604

Merged
merged 12 commits into from
Jul 20, 2023

Conversation

asinghvi17
Copy link
Member

in CairoMakie

Description

Fixes #2603

Because we intercept poly in CairoMakie, linestyle is not respected during polygon stroking. This PR just adds that.

Type of change

Delete options that do not apply:

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • Added an entry in NEWS.md (for new features and breaking changes)
  • Added or changed relevant sections in the documentation
  • Added unit tests for new algorithms, conversion methods, etc.
  • Added reference image tests for new plotting functions, recipes, visual options, etc.

@asinghvi17 asinghvi17 added the CairoMakie This relates to CairoMakie, the vector backend for Makie based on Cairo. label Jan 17, 2023
@MakieBot
Copy link
Collaborator

MakieBot commented Jan 17, 2023

Compile Times benchmark

Note, that these numbers may fluctuate on the CI servers, so take them with a grain of salt. All benchmark results are based on the mean time and negative percent mean faster than the base branch. Note, that GLMakie + WGLMakie run on an emulated GPU, so the runtime benchmark is much slower. Results are from running:

using_time = @ctime using Backend
# Compile time
create_time = @ctime fig = scatter(1:4; color=1:4, colormap=:turbo, markersize=20, visible=true)
display_time = @ctime Makie.colorbuffer(display(fig))
# Runtime
create_time = @benchmark fig = scatter(1:4; color=1:4, colormap=:turbo, markersize=20, visible=true)
display_time = @benchmark Makie.colorbuffer(display(fig))
using create display create display
GLMakie 13.99s (13.87, 14.07) 0.08+- 1.28s (1.26, 1.30) 0.02+- 861.06ms (828.10, 971.60) 49.33+- 12.47ms (12.13, 12.72) 0.22+- 109.50ms (105.99, 114.62) 2.63+-
master 13.97s (13.75, 14.52) 0.26+- 1.29s (1.26, 1.34) 0.03+- 840.74ms (821.53, 873.36) 18.67+- 12.47ms (12.23, 12.93) 0.25+- 107.96ms (105.26, 111.75) 2.25+-
evaluation +0.11%, 0.02s invariant (0.08d, 0.88p, 0.17std) -0.65%, -0.01s invariant (-0.39d, 0.49p, 0.02std) +2.36%, 20.33ms invariant (0.55d, 0.34p, 34.00std) +0.01%, 0.0ms invariant (0.01d, 0.99p, 0.24std) +1.40%, 1.54ms invariant (0.63d, 0.26p, 2.44std)
CairoMakie 9.60s (9.49, 9.84) 0.11+- 1.04s (1.02, 1.06) 0.02+- 221.03ms (214.28, 224.63) 3.49+- 9.43ms (9.32, 9.50) 0.06+- 5.62ms (5.54, 5.72) 0.07+-
master 9.55s (9.52, 9.60) 0.03+- 1.03s (1.01, 1.06) 0.01+- 233.58ms (231.51, 235.47) 1.64+- 9.45ms (9.37, 9.56) 0.06+- 5.65ms (5.54, 5.72) 0.06+-
evaluation +0.52%, 0.05s invariant (0.60d, 0.30p, 0.07std) +0.97%, 0.01s invariant (0.69d, 0.22p, 0.01std) -5.68%, -12.55ms faster✅ (-4.61d, 0.00p, 2.56std) -0.20%, -0.02ms invariant (-0.32d, 0.56p, 0.06std) -0.45%, -0.03ms invariant (-0.38d, 0.49p, 0.07std)
WGLMakie 14.35s (13.82, 15.15) 0.49+- 1.34s (1.29, 1.43) 0.05+- 12.74s (12.29, 13.38) 0.40+- 18.00ms (15.97, 25.81) 3.48+- 1.25s (1.20, 1.30) 0.03+-
master 14.39s (14.04, 14.83) 0.33+- 1.29s (1.23, 1.37) 0.05+- 12.71s (12.20, 13.09) 0.34+- 16.66ms (15.23, 18.46) 1.18+- 1.27s (1.19, 1.35) 0.05+-
evaluation -0.26%, -0.04s invariant (-0.09d, 0.87p, 0.41std) +3.74%, 0.05s invariant (1.07d, 0.07p, 0.05std) +0.22%, 0.03s invariant (0.08d, 0.89p, 0.37std) +7.43%, 1.34ms noisy🤷‍♀️ (0.51d, 0.37p, 2.33std) -1.20%, -0.02s invariant (-0.33d, 0.55p, 0.04std)

@asinghvi17 asinghvi17 added the bug label Jan 17, 2023
@asinghvi17 asinghvi17 marked this pull request as ready for review January 19, 2023 02:25
@asinghvi17
Copy link
Member Author

I'm wondering if we should introduce a new strokestyle attribute to poly instead, which inherits from linestyle. Presumably, passing linestyle was not intended to affect the polygon's stroke, it's only a fluke that the structure of the recipe means that it does.

@SimonDanisch SimonDanisch merged commit 0b7e590 into master Jul 20, 2023
13 checks passed
@SimonDanisch SimonDanisch deleted the as/cairo_poly_strokestyle branch July 20, 2023 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug CairoMakie This relates to CairoMakie, the vector backend for Makie based on Cairo.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CairoMakie ignores linestyle = :dash in Makie.poly
3 participants