Skip to content

Commit 7011167

Browse files
committed
Added bp return value and updated function docs
1 parent 4278c00 commit 7011167

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ext/QuantumToolboxCairoMakieExt.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ Plot the [Fock state](https://en.wikipedia.org/wiki/Fock_state) distribution of
163163
# Returns
164164
- `fig`: The figure object.
165165
- `ax`: The axis object.
166+
- `bp`: The barplot object.
166167
167168
!!! note "Import library first"
168169
[`CairoMakie`](https://github.com/MakieOrg/Makie.jl/tree/master/CairoMakie) must first be imported before using this function.
@@ -207,14 +208,14 @@ function _plot_fock_distribution(
207208
lyt = GridLayout(location)
208209
ax = Axis(lyt[1, 1])
209210

210-
barplot!(ax, xvec, real(diag(ρ)); kwargs...)
211+
bp = barplot!(ax, xvec, real(diag(ρ)); kwargs...)
211212

212213
ax.xticks = (xvec, fock_numbers)
213214
ax.xlabel = "Fock number"
214215
ax.ylabel = "Occupation probability"
215216
unit_y_range && ylims!(ax, 0, 1)
216217

217-
return fig, ax
218+
return fig, ax, bp
218219
end
219220

220221
raw"""

0 commit comments

Comments
 (0)