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

Added way for PolarAxis to pull fontsize attribute from Figure #4314

Merged
merged 15 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
- Added option `label_position = :center` to place labels centered over each bar [#4274](https://github.com/MakieOrg/Makie.jl/pull/4274).
- Fixed Boundserror in clipped multicolor lines in CairoMakie [#4313](https://github.com/MakieOrg/Makie.jl/pull/4313)
- Fix float precision based assertions error in GLMakie.volume [#4311](https://github.com/MakieOrg/Makie.jl/pull/4311)
- Added way for `PolarAxis` to pull fontsize attribute from `Figure()` [#4314](https://github.com/MakieOrg/Makie.jl/pull/4314)
NeunMonde marked this conversation as resolved.
Show resolved Hide resolved

## [0.21.9] - 2024-08-27

Expand Down
2 changes: 1 addition & 1 deletion ReferenceTests/src/tests/figures_and_makielayout.jl
Original file line number Diff line number Diff line change
Expand Up @@ -339,4 +339,4 @@ end
translate!(hl, 0, 1, 0)
translate!(vl, 1, 0, 0)
f
end
end
4 changes: 2 additions & 2 deletions src/makielayout/types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1871,7 +1871,7 @@ end
"The formatter for the `r` ticks"
rtickformat = Makie.automatic
"The fontsize of the `r` tick labels."
rticklabelsize::Float32 = inherit(scene, (:Axis, :xticklabelsize), 16)
rticklabelsize::Float32 = inherit(scene, (:Axis, :yticklabelsize), inherit(scene, :fontsize, 16))
"The font of the `r` tick labels."
rticklabelfont = inherit(scene, (:Axis, :xticklabelfont), inherit(scene, :font, Makie.defaultfont()))
"The color of the `r` tick labels."
Expand Down Expand Up @@ -1907,7 +1907,7 @@ end
"The formatter for the `theta` ticks."
thetatickformat = Makie.automatic
"The fontsize of the `theta` tick labels."
thetaticklabelsize::Float32 = inherit(scene, (:Axis, :yticklabelsize), 16)
thetaticklabelsize::Float32 = inherit(scene, (:Axis, :xticklabelsize), inherit(scene, :fontsize, 16))
"The font of the `theta` tick labels."
thetaticklabelfont = inherit(scene, (:Axis, :yticklabelfont), inherit(scene, :font, Makie.defaultfont()))
"The color of the `theta` tick labels."
Expand Down
23 changes: 23 additions & 0 deletions test/PolarAxis.jl
Original file line number Diff line number Diff line change
Expand Up @@ -149,4 +149,27 @@
ax = PolarAxis(fig[1, 1], radius_at_origin = -1.0, rlimits = (0, 10))
@test ax.scene.transformation.transform_func[].r0 == -1.0
end

@testset "PolarAxis fontsize from Figure()" begin
fig = Figure(fontsize = 50)
ax = PolarAxis(fig[1, 1])
@test ax.rticklabelsize[] == 50
@test ax.thetaticklabelsize[] == 50
end

@testset "PolarAxis fontsize from :Axis" begin
fig = Figure(; Axis = (; xticklabelsize = 35, yticklabelsize = 65))
ax = PolarAxis(fig[1, 1])
@test ax.thetaticklabelsize[] == 35
@test ax.rticklabelsize[] == 65
end

@testset "PolarAxis fontsize from Theme()" begin
fig = Figure()
ax = PolarAxis(fig[1, 1])
fontsize_theme = Theme(fontsize = 10)
set_theme!(fontsize_theme)
@test ax.rticklabelsize[] == 10
@test ax.thetaticklabelsize[] == 10
NeunMonde marked this conversation as resolved.
Show resolved Hide resolved
end
end
Loading