Skip to content
Snippets Groups Projects
Verified Commit 4d5d7761 authored by Michiel Cottaar's avatar Michiel Cottaar
Browse files

Add plotting function if Makie is installed

parent d965d5a8
No related branches found
No related tags found
No related merge requests found
...@@ -8,6 +8,7 @@ Ipopt = "b6b21f68-93f8-5de0-b562-5493be1d77c9" ...@@ -8,6 +8,7 @@ Ipopt = "b6b21f68-93f8-5de0-b562-5493be1d77c9"
JuMP = "4076af6c-e467-56ae-b986-b466b2749572" JuMP = "4076af6c-e467-56ae-b986-b466b2749572"
Juniper = "2ddba703-00a4-53a7-87a5-e8b9971dde84" Juniper = "2ddba703-00a4-53a7-87a5-e8b9971dde84"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
MakieCore = "20f20a25-4f0e-4fdf-b5d1-57303727442b"
Polynomials = "f27b6e38-b328-58d1-80ce-0feddd5e7a45" Polynomials = "f27b6e38-b328-58d1-80ce-0feddd5e7a45"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7" Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
QuadGK = "1fd47b50-473d-5c70-9696-f719f8f3bcdc" QuadGK = "1fd47b50-473d-5c70-9696-f719f8f3bcdc"
......
...@@ -130,4 +130,45 @@ function SequenceDiagram(seq::BaseSequence) ...@@ -130,4 +130,45 @@ function SequenceDiagram(seq::BaseSequence)
for symbol in [:RFx, :RFy, :G, :Gx, :Gy, :Gz, :ADC]]...) for symbol in [:RFx, :RFy, :G, :Gx, :Gy, :Gz, :ADC]]...)
end end
"""
plot(sequence; kwargs...)
plot!([scene,] sequence; kwargs...)
plot_sequence(sequence; kwargs...)
plot_sequence!([scene,] sequence; kwargs...)
Plot the sequence diagram.
This function will only work if [`Makie`](https://makie.org) is installed and imported.
## Attributes
### Line properties
- `linecolor` sets the color of the lines. If you want to set the text color to the same value, you can also use `color=...`.
- `linewidth=1.5` sets the width of the lines.
- `instant_width=3.` sets the width of any instant gradients or pulses with respect to the `linewidth`.
### Text properties
- `textcolor` sets the color of the text. If you want to set the line color to the same value, you can also use `color=...`.
- `font` sets whether the rendered text is :regular, :bold, or :italic.
- `fontsize`: set the size of each character.
$(Base.Docs.doc(generic_plot_attributes!))
"""
@recipe(Plot_Sequence, sequence) do scene
attr = Attributes(
color = theme(scene, :textcolor),
linecolor = automatic,
linewidth = 1.5,
instant_width = 3.,
textcolor = automatic,
font = theme(scene, :font),
fonts = theme(scene, :fonts),
fontsize = theme(scene, :fontsize),
fxaa = true,
)
generic_plot_attributes!(attr)
return attr
end
end end
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment