diff --git a/CHANGELOG.md b/CHANGELOG.md index 9835a273267..6064c76b08f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - Fixed issue with CairoMakie rendering scene backgrounds at the wrong position [#4425](https://github.com/MakieOrg/Makie.jl/pull/4425) - Fix incorrect inverse transformation in `position_on_plot` for lines, causing incorrect tooltip placement in DataInspector [#4402](https://github.com/MakieOrg/Makie.jl/pull/4402) +- `PolarAxis` font size now defaults to global figure `fontsize` in the absence of specific `Axis` theming [#4314](https://github.com/MakieOrg/Makie.jl/pull/4314) - `MultiplesTicks` accepts new option `strip_zero=true`, allowing labels of the form `0x` to be `0` [#4372](https://github.com/MakieOrg/Makie.jl/pull/4372) ## [0.21.12] - 2024-09-28 diff --git a/src/makielayout/types.jl b/src/makielayout/types.jl index 6a721cd7eff..a0f6ab3ddda 100644 --- a/src/makielayout/types.jl +++ b/src/makielayout/types.jl @@ -1880,7 +1880,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." @@ -1916,7 +1916,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." diff --git a/test/PolarAxis.jl b/test/PolarAxis.jl index fadd71beae5..c05b24c0289 100644 --- a/test/PolarAxis.jl +++ b/test/PolarAxis.jl @@ -149,4 +149,28 @@ 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 + fontsize_theme = Theme(fontsize = 10) + with_theme(fontsize_theme) do + fig = Figure() + ax = PolarAxis(fig[1, 1]) + @test ax.rticklabelsize[] == 10 + @test ax.thetaticklabelsize[] == 10 + end + end end \ No newline at end of file