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

Optimal colorbar placement + save space for GeoMakie #130

Open
AlexisRenchon opened this issue Oct 18, 2024 · 3 comments
Open

Optimal colorbar placement + save space for GeoMakie #130

AlexisRenchon opened this issue Oct 18, 2024 · 3 comments
Assignees

Comments

@AlexisRenchon
Copy link
Member

Current GeoMakie (as of ClimaAnalysis v0.5.10) colorbar waste a lot of space.
Placing the colorbar horizontally below the globe map would save a lot of space, as well as reducing space between the map and the colorbar.

MWE:

using GeoMakie
using CairoMakie
fig = Figure(size = (800, 500))
ga = GeoAxis(
    fig[1, 1]; # any cell of the figure's layout
    dest = "+proj=wintri", # the CRS in which you want to plot
)
lines!(ga, GeoMakie.coastlines()) # plot coastlines from Natural Earth as a reference
scatter!(ga, -120:15:120, -60:7.5:60; color = -60:7.5:60, strokecolor = (:black, 0.2))
b = Colorbar(fig[2,1],
        vertical = false,
        width = Relative(0.75),
        label = L"\text{GPP} \, (\mu\text{mol m}^{-2} \, \text{s}^{-1})")
save("fig.png", fig)

key elements in MWE are vertical = false, and width = Relative(0.75),

Note that the default padding (white space betwwen plot and edges, or between map and colorbar) is still very large, reducing it would be amazing.

fig

@AlexisRenchon
Copy link
Member Author

@Sbozzolo does that sound okay to you? (for ClimaAtmos and all users)

@Sbozzolo
Copy link
Member

I am fine, but I would like to see a ClimaCoupler bias/leaderboard plot before merging this.

Let me point out that the plotting functions in ClimaAnalysis are probably not the best tool for publication-grade plots (they have to be general enough to be good enough for most uses). In that case, when you want to have full control of the plot, you can use ClimaAnalysis to extract the data, but make the plot with your favorite tool (Makie, Python, LaTeX, ...).

@AlexisRenchon
Copy link
Member Author

It's okay to put low priority on this. I agree with your point about publication quality, this is more intended for most use - for example to make quick slides, or for the dashboard

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants