Skip to content

Add ticks to PolarAxis #4902

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

Merged
merged 20 commits into from
Apr 28, 2025
Merged

Add ticks to PolarAxis #4902

merged 20 commits into from
Apr 28, 2025

Conversation

ffreyer
Copy link
Collaborator

@ffreyer ffreyer commented Apr 1, 2025

Description

Fixes #4773

When I saw the issue I thought this just needed some modifications of PolarAxis but there are actually no ticks yet. This pr adds them.

On the attributes mentioned in the issue:

  • color, visible, width, size is self explanatory
  • align controls to which side of the frame/grid the ticks are drawn (0 on ticklabel side, 1 opposite side)
  • mirrored may make sense for circle sectors with or without rmin > 0, as there is an opposite side to mirror to

TODO:

  • add rticks and theta ticks
  • add minor ticks
  • consider adding ticksmirrored
  • refimg tests
  • test tick label rotations with different combinations of direction & ticksmirrored
  • docs/example

Example

f = Figure()
a = PolarAxis(f[1,1],
    rticksvisible = true, rticksize = 10, rtickwidth = 4, rtickcolor = :red,
    thetaticksvisible = true, thetaticksize = 10, thetatickwidth = 4, thetatickcolor = :blue
)
f

image

Type of change

  • New feature (non-breaking change which adds functionality)

Checklist

  • Added an entry in CHANGELOG.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.

@github-project-automation github-project-automation bot moved this to Work in progress in PR review Apr 1, 2025
@MakieBot
Copy link
Collaborator

MakieBot commented Apr 1, 2025

Benchmark Results

SHA: 39300418bb9823d5a5f09e106298e1fdf6837af7

Warning

These results are subject to substantial noise because GitHub's CI runs on shared machines that are not ideally suited for benchmarking.

GLMakie
CairoMakie
WGLMakie

@ffreyer
Copy link
Collaborator Author

ffreyer commented Apr 1, 2025

I think I got mirroring working though I'm interpreting it differently from Axis. In Axis it only moves ticks. Moving tick labels happens through xaxisposition = :top/:bottom and yaxisposition = :left/:right. For PolarAxis I'm letting r/thetaticksmirrored handle that too, because left/right/bottom/top changes with ax.direction and axis rotation.
image

@ffreyer ffreyer marked this pull request as ready for review April 7, 2025 14:56
@ffreyer ffreyer moved this from Work in progress to Ready to review in PR review Apr 7, 2025
@ffreyer ffreyer closed this Apr 28, 2025
@github-project-automation github-project-automation bot moved this from Ready to review to Closed in PR review Apr 28, 2025
@ffreyer ffreyer reopened this Apr 28, 2025
@ffreyer ffreyer merged commit 042be3e into master Apr 28, 2025
43 checks passed
@ffreyer ffreyer deleted the ff/PolarAxis-attributes branch April 28, 2025 23:55
@github-project-automation github-project-automation bot moved this from Closed to Merged in PR review Apr 28, 2025
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.

PolarAxis ticks
2 participants