Created
May 6, 2022 11:12
-
-
Save jkrumbiegel/880eb874cc5f5e02659bbf482a9725a7 to your computer and use it in GitHub Desktop.
Makie align y labels
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function align_ylabels!(axs...) | |
max_extent = maximum(axs) do ax | |
tight_yticklabel_spacing!(ax) | |
ax.yticklabelspace[] | |
end | |
for ax in axs | |
ax.yticklabelspace = max_extent | |
end | |
return | |
end | |
f = Figure() | |
ax1 = Axis(f[1, 1], ylabel = "Y Label") | |
ax2 = Axis(f[2, 1], limits = (nothing, (1000, 9000)), ylabel = "Y Label") | |
ax3 = Axis(f[3, 1], limits = (nothing, (0.0001, 0.0002)), ylabel = "Y Label") | |
align_ylabels!(ax1, ax2, ax3) | |
f |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment