Skip to content

Commit a0a37c3

Browse files
committed
Format plot title in docs
1 parent ebbdfea commit a0a37c3

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

docs/src/basic_example.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,9 @@ After running the simulation, the results can be visualized using [Plots.jl](htt
118118
plot the solution at the final time by calling `plot` on a `Pair` of the `Semidiscretization` and the corresponding `ODESolution` `sol`. The result is depicted in the following picture.
119119

120120
```@example overview
121-
using Plots
122-
# default( grid=true, box=:on, dpi=100, titlefont=font(16), linewidth=3, gridlinewidth=2, markersize=4, markerstrokewidth=2, xtickfontsize=14, ytickfontsize=14, xguidefontsize=16, yguidefontsize=16, ztickfontsize=14, zguidefontsize=16, legendfontsize=14) # hide
123-
plot(semi => sol)
121+
using Plots, Printf
122+
# default(grid=true, box=:on, dpi=100, titlefont=font(16), linewidth=3, gridlinewidth=2, markersize=4, markerstrokewidth=2, xtickfontsize=14, ytickfontsize=14, xguidefontsize=16, yguidefontsize=16, ztickfontsize=14, zguidefontsize=16, legendfontsize=14) # hide
123+
plot(semi => sol, plot_title = @sprint "BBM-BBM equations at t = %.2f" last(tspan))
124124
savefig("shoaling_solution.png") # hide
125125
nothing # hide
126126
```
@@ -135,7 +135,8 @@ Plotting an animation over time can, e.g., be done by the following command, whi
135135

136136
```@example overview
137137
anim = @animate for step in 1:length(sol.u)
138-
plot(semi => sol, plot_initial = true, conversion = waterheight_total, step = step, xlims = (-50, 20), ylims = (-0.8, 0.1))
138+
plot(semi => sol, plot_initial = true, conversion = waterheight_total, step = step, xlims = (-50, 20), ylims = (-0.8, 0.1),
139+
plot_title = @sprintf "BBM-BBM equations at t = %.2f" sol.t[step])
139140
end
140141
gif(anim, "shoaling_solution.gif", fps = 25)
141142
nothing # hide

0 commit comments

Comments
 (0)