CliMA / CliMA/ClimaAnalysis.jl

Optimal colorbar placement + save space for GeoMakie

Open
#130 3 comments 0 reactions 1 assignee Claimed by @ph-kev View on GitHub
Dominant language
Julia
Stars
12
Forks
5
Avg merge
6d 17h
Merged PRs (30d)
3

Description

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](https://github.com/user-attachments/assets/80179d31-7214-4104-b317-ec5141e793f9)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.