Plots.jl recipes
Page Info
Audience: Intermediate
Prerequisites:
Plots.jlbackend configuredTime: 8 minutes
Output: 2D/3D MTG topology diagrams with Plots.jl
PlantGeom.jl provides recipes to make plots using Plots.jl. The only recipe so far is to make a diagram of the MTG tree. This is especially useful to control the integrity of and MTG (where it branches, where are the different scales...).
To use this recipe, load Plots.jl and select any backend. The built-in plotly() backend is a convenient option for interactive HTML output and does not require an additional plotting-backend dependency.
The plot recipe provides some arguments to customize the plot:
mode = "2d": The mode for plotting, either "2d" or "3d"node_color = :black: the node color, can be a color or any MTG attributeedge_color = node_color: same asnode_color, but for the edgescolormap = :viridis: the colormap used for coloringcolor_missing = RGBA(0, 0, 0, 0.3): The color used for missing values
using Plots
plotly()
opf = read_opf(joinpath(dirname(dirname(pathof(PlantGeom))),"test","files","simple_plant.opf"))
plot(opf, node_color = :Length)The default plot is a 2D projection of the MTG, but you can also get a 3D projection using the mode keyword argument:
plot(opf, node_color = :Length, mode = "3d")