# Figure caption in Pluto

**URL:** <https://discourse.julialang.org/t/figure-caption-in-pluto/85564>\
**Category:** Visualization\
**Tags:** pluto\
**Created:** [August 10, 2022, 4:42am UTC](https://discourse.julialang.org/t/figure-caption-in-pluto/85564 "2022-08-10T04:42:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![grero](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/grero/32/109_2.png) [@grero](https://discourse.julialang.org/u/grero)\
**Post date:** [August 10, 2022, 4:42am UTC](https://discourse.julialang.org/t/figure-caption-in-pluto/85564/1 "2022-08-10T04:42:50Z")

</div>

This may be obvious to Pluto users, but I was struggling for a while with creating captioned figures in Pluto notebooks. I used to have a cell with a Makie figure as output, followed by a Markdown cell containing the caption, but sometimes these would become separated as I worked on the notebook. Looking through the PlutoUI roadmap, there appears to be a plan to include captioned figures, but I couldn’t find anything that works now. So, the solution that worked for me was to interpolate the figure object in an md-string, as the following example shows:

```julia
### A Pluto.jl notebook ###
# v0.19.9

using Markdown
using InteractiveUtils

# ╔═╡ 5a71a298-1865-11ed-1107-59fe5409d584
begin
	using Makie
	using CairoMakie
end

# ╔═╡ ddb846a3-12ce-46e0-b597-7a837f97a051
let
	x = range(0,stop=1.0, length=20)
	fig = Figure(resolution=(500,500))
	ax = Axis(fig[1,1])
	lines!(ax, x, x.^2)
	md"""
	$(fig)
	**Figure 1** This is a caption
	"""
end

```

As I said, it is kind of an obvious solution, but I thought I’d leave it here in case someone finds it useful.
