Skip to content

Commit 2d09a66

Browse files
committed
space out DQConversion docstring a bit
1 parent 1afe364 commit 2d09a66

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

ext/DynamicQuantitiesMakieExt.jl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,30 @@ end
2828
# TODO: Maybe only allow symbolic units to avoid bugs?
2929
"""
3030
DQConversion(unit=automatic; units_in_label=false)
31+
3132
Allows to plot arrays of DynamicQuantity objects into an axis.
33+
3234
# Arguments
3335
- `unit=automatic`: sets the unit as conversion target. If left at automatic, the best unit will be chosen for all plots + values plotted to the axis (e.g. years for long periods, or km for long distances, or nanoseconds for short times).
3436
- `units_in_label=true`: controls, whether plots are shown in the label_prefix of the axis labels, or in the tick labels
37+
3538
# Examples
39+
3640
```julia
3741
using DynamicQuantities, CairoMakie
42+
3843
# DQConversion will get chosen automatically:
3944
scatter(1:4, [1u"ns", 2u"ns", 3u"ns", 4u"ns"])
4045
```
46+
4147
Fix unit to always use Meter & display unit in the xlabel:
48+
4249
```julia
4350
# Temporary until this is upstreamed to Makie.jl
4451
const DQConversion = Base.get_extension(DynamicQuantities, :DynamicQuantitiesMakieExt).DQConversion
52+
4553
dqc = DQConversion(us"m"; units_in_label=false)
54+
4655
scatter(1:4, [0.01u"km", 0.02u"km", 0.03u"km", 0.04u"km"]; axis=(dim2_conversion=dqc, xlabel="x (km)"))
4756
```
4857
"""

0 commit comments

Comments
 (0)