Skip to content

Commit

Permalink
Use CairoMakie v0.11 for example/docs (#3443)
Browse files Browse the repository at this point in the history
* use CairoMakie v0.11

* fix doctest

* resolve dependencies

* fix journal name
  • Loading branch information
navidcy authored Jan 25, 2024
1 parent a2694e6 commit 34e9fab
Show file tree
Hide file tree
Showing 15 changed files with 292 additions and 248 deletions.
494 changes: 269 additions & 225 deletions docs/Manifest.toml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Polynomials = "f27b6e38-b328-58d1-80ce-0feddd5e7a45"
TimesDates = "bdfc003b-8df8-5c39-adcd-3a9087f5df4a"

[compat]
CairoMakie = "0.10.11"
CairoMakie = "0.11"
Documenter = "1"
DocumenterCitations = "1"
Literate = "≥2.9.0"
Expand Down
6 changes: 3 additions & 3 deletions docs/oceananigans.bib
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ @article{Verstappen18
title = {How much eddy dissipation is needed to counterbalance the nonlinear production of small, unresolved scales in a large-eddy simulation of turbulence?},
volume = {176},
doi = {10.1016/j.compfluid.2016.12.016},
journal = {Computers & Fluids},
journal = {Computers \& Fluids},
author = {Verstappen, Roel},
year = {2018},
pages = {276--284}
Expand All @@ -665,7 +665,7 @@ @article{Bruneau06
volume = {35},
doi = {10/fvshbk},
number = {3},
journal = {Computers & Fluids},
journal = {Computers \& Fluids},
author = {Bruneau, Charles-Henri and Saad, Mazen},
year = {2006},
pages = {326--348}
Expand All @@ -676,7 +676,7 @@ @article{Botella98
volume = {27},
doi = {10/chbd5b},
number = {4},
journal = {Computers & Fluids},
journal = {Computers \& Fluids},
author = {Botella, O. and Peyret, R.},
year = {1998},
pages = {421--433}
Expand Down
2 changes: 1 addition & 1 deletion docs/src/model_setup/grids.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ We can easily visualize the spacing of ``y`` and ``z`` directions.
```@example 1
using CairoMakie

fig = Figure(resolution=(800, 900))
fig = Figure(size=(800, 900))

ax1 = Axis(fig[1, 1]; xlabel = "y (m)", ylabel = "y-spacing (m)", limits = (nothing, (0, 250)))
lines!(ax1, grid.yᵃᶜᵃ[1:Ny], grid.Δyᵃᶜᵃ[1:Ny])
Expand Down
4 changes: 2 additions & 2 deletions examples/baroclinic_adjustment.jl
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ nothing #hide
# Then we create a 3D axis. We use `zonal_slice_displacement` to control where the plot of the instantaneous
# zonal average flow is located.

fig = Figure(resolution = (1600, 800))
fig = Figure(size = (1600, 800))

zonal_slice_displacement = 1.2

Expand Down Expand Up @@ -309,7 +309,7 @@ yv = yv ./ 1e3 # convert m -> km

set_theme!(Theme(fontsize=24))

fig = Figure(resolution=(1800, 1000))
fig = Figure(size=(1800, 1000))

axb = Axis(fig[1, 2], xlabel="x (km)", ylabel="y (km)", aspect=1)
axζ = Axis(fig[1, 3], xlabel="x (km)", ylabel="y (km)", aspect=1, yaxisposition=:right)
Expand Down
4 changes: 2 additions & 2 deletions examples/convecting_plankton.jl
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ set_theme!(Theme(fontsize = 24, linewidth=2))

times = range(0, 12hours, length=100)

fig = Figure(resolution = (800, 300))
fig = Figure(size = (800, 300))
ax = Axis(fig[1, 1]; xlabel = "Time (hours)", ylabel = "Surface buoyancy flux (m² s⁻³)")

flux_time_series = [buoyancy_flux(0, t, buoyancy_flux_parameters) for t in times]
Expand Down Expand Up @@ -239,7 +239,7 @@ w_lims = (-w_lim, w_lim)

P_lims = (0.95, 1.1)

fig = Figure(resolution = (1200, 1000))
fig = Figure(size = (1200, 1000))

ax_w = Axis(fig[2, 2]; xlabel = "x (m)", ylabel = "z (m)", aspect = 1)
ax_P = Axis(fig[3, 2]; xlabel = "x (m)", ylabel = "z (m)", aspect = 1)
Expand Down
4 changes: 2 additions & 2 deletions examples/horizontal_convection.jl
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ axis_kwargs = (xlabel = L"x / H",
aspect = Lx / H,
titlesize = 20)

fig = Figure(resolution = (600, 1100))
fig = Figure(size = (600, 1100))

ax_s = Axis(fig[2, 1];
title = L"speed, $(u^2+w^2)^{1/2} / (L_x b_*) ^{1/2}", axis_kwargs...)
Expand Down Expand Up @@ -336,7 +336,7 @@ for i = 1:length(t)
Nu[i] = χ[1, 1, 1] / χ_diff
end

fig = Figure(resolution = (850, 450))
fig = Figure(size = (850, 450))

ax_KE = Axis(fig[1, 1], xlabel = L"t \, (b_* / L_x)^{1/2}", ylabel = L"KE $ / (L_x b_*)$")
lines!(ax_KE, t, kinetic_energy; linewidth = 3)
Expand Down
2 changes: 1 addition & 1 deletion examples/internal_wave.jl
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ run!(simulation)
using CairoMakie
set_theme!(Theme(fontsize = 24))

fig = Figure(resolution = (600, 600))
fig = Figure(size = (600, 600))

ax = Axis(fig[2, 1]; xlabel = "x", ylabel = "z",
limits = ((-π, π), (-π, π)), aspect = AxisAspect(1))
Expand Down
8 changes: 4 additions & 4 deletions examples/kelvin_helmholtz_instability.jl
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ zC = znodes(grid, Center())

Ri, h = B.parameters

fig = Figure(resolution = (850, 450))
fig = Figure(size = (850, 450))

ax = Axis(fig[1, 1], xlabel = "U(z)", ylabel = "z")
lines!(ax, shear_flow.(0, zC, 0), zC; linewidth = 3)
Expand Down Expand Up @@ -307,7 +307,7 @@ growth_rates, power_method_data = estimate_growth_rate(simulation, mean_perturba

n = Observable(1)

fig = Figure(resolution=(800, 600))
fig = Figure(size=(800, 600))

kwargs = (xlabel="x", ylabel="z", limits = ((xω[1], xω[end]), (zω[1], zω[end])), aspect=1,)

Expand Down Expand Up @@ -415,7 +415,7 @@ n = Observable(1)
ωₙ = @lift interior(ω_timeseries, :, 1, :, $n)
bₙ = @lift interior(b_timeseries, :, 1, :, $n)

fig = Figure(resolution=(800, 600))
fig = Figure(size=(800, 600))

kwargs = (xlabel="x", ylabel="z", limits = ((xω[1], xω[end]), (zω[1], zω[end])), aspect=1,)

Expand Down Expand Up @@ -474,7 +474,7 @@ n = Observable(1)
Ωₙ = @lift interior(Ω_timeseries, :, 1, :, $n)
Bₙ = @lift interior(B_timeseries, :, 1, :, $n)

fig = Figure(resolution=(800, 600))
fig = Figure(size=(800, 600))

kwargs = (xlabel="x", ylabel="z", limits = ((xω[1], xω[end]), (zω[1], zω[end])), aspect=1,)

Expand Down
2 changes: 1 addition & 1 deletion examples/langmuir_turbulence.jl
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ wxy_title = @lift string("w(x, y, t) at z=-8 m and t = ", prettytime(times[$n]))
wxz_title = @lift string("w(x, z, t) at y=0 m and t = ", prettytime(times[$n]))
uxz_title = @lift string("u(x, z, t) at y=0 m and t = ", prettytime(times[$n]))

fig = Figure(resolution = (850, 850))
fig = Figure(size = (850, 850))

ax_B = Axis(fig[1, 4];
xlabel = "Buoyancy (m s⁻²)",
Expand Down
4 changes: 2 additions & 2 deletions examples/ocean_wind_mixing_and_convection.jl
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ grid = RectilinearGrid(size = (Nx, Nx, Nz),

# We plot vertical spacing versus depth to inspect the prescribed grid stretching:

fig = Figure(resolution=(1200, 800))
fig = Figure(size=(1200, 800))
ax = Axis(fig[1, 1], ylabel = "Depth (m)", xlabel = "Vertical spacing (m)")

lines!(ax, zspacings(grid, Center()), znodes(grid, Center()))
Expand Down Expand Up @@ -258,7 +258,7 @@ n = Observable(intro)
Sₙ = @lift interior(time_series.S[$n], :, 1, :)
νₑₙ = @lift interior(time_series.νₑ[$n], :, 1, :)

fig = Figure(resolution = (1000, 500))
fig = Figure(size = (1000, 500))

axis_kwargs = (xlabel="x (m)",
ylabel="z (m)",
Expand Down
2 changes: 1 addition & 1 deletion examples/shallow_water_Bickley_jet.jl
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ nothing #hide
# Read in the `output_writer` for the two-dimensional fields and then create an animation
# showing both the total and perturbation vorticities.

fig = Figure(resolution = (1200, 660))
fig = Figure(size = (1200, 660))

axis_kwargs = (xlabel = "x", ylabel = "y")
ax_ω = Axis(fig[2, 1]; title = "Total vorticity, ω", axis_kwargs...)
Expand Down
2 changes: 1 addition & 1 deletion examples/tilted_bottom_boundary_layer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ xv, yv, zv = nodes(V)

ds = NCDataset(simulation.output_writers[:fields].filepath, "r")

fig = Figure(resolution = (800, 600))
fig = Figure(size = (800, 600))

axis_kwargs = (xlabel = "Across-slope distance (m)",
ylabel = "Slope-normal\ndistance (m)",
Expand Down
2 changes: 1 addition & 1 deletion examples/two_dimensional_turbulence.jl
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ set_theme!(Theme(fontsize = 24))

@info "Making a neat movie of vorticity and speed..."

fig = Figure(resolution = (800, 500))
fig = Figure(size = (800, 500))

axis_kwargs = (xlabel = "x",
ylabel = "y",
Expand Down
2 changes: 1 addition & 1 deletion src/AbstractOperations/conditional_operations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ julia> f(i, j, k, grid, c) = i < 2; d = condition_operand(cos, c, f, 10)
ConditionalOperation at (Center, Center, Center)
├── operand: 2×1×1 Field{Center, Center, Center} on RectilinearGrid on CPU
├── grid: 2×1×1 RectilinearGrid{Float64, Periodic, Periodic, Bounded} on CPU with 3×3×3 halo
├── func: cos (generic function with 40 methods)
├── func: cos (generic function with 31 methods)
├── condition: f (generic function with 1 method)
└── mask: 10
Expand Down

0 comments on commit 34e9fab

Please sign in to comment.