Hi,
I am trying to create circles using CairoMakie. But they turn out oval. What’s up?
MWE:
using CairoMakie
using Makie.GeometryBasics
const global inch::Float64 = 96
const global cm::Float64 = inch / 2.54
const global pt::Float64 = 4 / 3
const global column_width::Float64 = 8.6cm
f = Figure(; figure_padding=(2.0pt, 2.0pt, 2.0pt, 2.0pt), size=(column_width, column_width))
ax_gs = Axis(f[1, 1], spinewidth=2.0pt, aspect=1.0)
radius = 8pt
function cf_particle(ax, x, y) ### Show a CF at x, y
poly!(ax, Circle(Point2f(x, y), 1.00 * radius), strokecolor=:black, strokewidth=2.0pt, color=:white, alpha=0.80)
poly!(ax, Circle(Point2f(x, y), 0.88 * radius), strokecolor=:black, strokewidth=0.0pt, color=:blue)
arrows!(ax, [x + radius * cos(pi / 4), x + radius * cos(3 * pi / 4)], [y + radius * sin(pi / 4), y + radius * sin(3 * pi / 4)], [0.0, 0.0], [radius, radius]; color=:black, linewidth=2.0pt)
return
end
cf_particle(ax_gs, 0, 0)
save("test.png", f, pt_per_unit=1200 / inch)
f
gives