Skip to content

Instantly share code, notes, and snippets.

@jkrumbiegel
Created May 31, 2024 08:42
Show Gist options
  • Save jkrumbiegel/6e6812d5cd7261f5b1128ff17a1eb2ab to your computer and use it in GitHub Desktop.
Save jkrumbiegel/6e6812d5cd7261f5b1128ff17a1eb2ab to your computer and use it in GitHub Desktop.
Makie mixed coordinate space text
f = Figure()
ax = Axis(f[1, 1])
relative_y(ax, x, y_rel) = lift(ax.finallimits) do lims
y = lims.origin[2] + lims.widths[2] * y_rel
Point(x, y)
end
text!(ax, relative_y(ax, 50, 0.8), text = "50, 0.8", yautolimits = false)
text!(ax, relative_y(ax, 50, 0.2), text = "50, 0.2", yautolimits = false)
text!(ax, relative_y(ax, 70, 0.5), text = "70, 0.5", yautolimits = false, align = (:right, :center))
f
@jkrumbiegel
Copy link
Author

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment