You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/model_creation/model_visualisation.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -88,34 +88,34 @@ In this section we demonstrate some of the ways that plot objects can be manipul
88
88
f, ax, p = plot_complexes(brusselator, show_rate_labels = true)
89
89
```
90
90
91
-
It seems like a bit of the top node is cut off. Let's hide the tick marks and grid and increase the top and bottom margins by increasing `yautolimitmargin`.
91
+
It seems like a bit of the top node is cut off. Let's increase the top and bottom margins by increasing `yautolimitmargin`.
92
92
```@example visualisation_graphs
93
-
hidedecorations!(ax)
94
-
ax.yautolimitmargin = (0.1, 0.1) # defaults to (0.05, 0.05)
93
+
ax.yautolimitmargin = (0.3, 0.3) # defaults to (0.15, 0.15)
95
94
ax.aspect = DataAspect()
95
+
f
96
96
```
97
97
98
-
There are many keyword arguments that can be passed to `plot_network` or `plot_complexes` to change the look of the graph (which get passed to the `graphplot` Makie recipe). Let's change the color of the nodes and make the inner labels a bit smaller. As before, we hide the tick marks and grid. Let's also give the plot a title.
98
+
There are many keyword arguments that can be passed to `plot_network` or `plot_complexes` to change the look of the graph (which get passed to the `graphplot` Makie recipe). Let's change the color of the nodes and make the inner labels a bit smaller. Let's also give the plot a title.
ax.yautolimitmargin = (0.1, 0.1) # defaults to (0.05, 0.05)
103
-
ax.aspect = DataAspect()
104
101
ax.title = "Brusselator"
102
+
f
105
103
```
106
104
107
105
Most of the kwargs that modify the nodes or edges will also accept a vector with the same length as the number of nodes or edges, respectively. See [here](https://graph.makie.org/stable/#The-graphplot-Recipe) for a full list of keyword arguments to `graph_plot`. Note that `plot_complexes` and `plot_network` default to `layout = Stress()` rather than `layout = Spring()`, since `Stress()` is better at generating plots with fewer edge crossings. More layout options and customizations (such as pinning nodes to certain positions) can be found in the [`NetworkLayout` documentation](https://juliagraphs.org/NetworkLayout.jl/stable/).
108
106
109
107
Once a graph is already created we can also change the keyword arguments by modifying the fields of the `Plot` object `p`.
110
108
```@example visualisation_graphs
111
109
p.node_color = :orange
110
+
f
112
111
```
113
112
114
113
Custom node positions can also be given, if the automatic layout is unsatisfactory.
115
114
```@example visualisation_graphs
116
115
fixedlayout = [(0,0), (1,0), (0,1), (1,1), (2,0)]
117
116
p.layout = fixedlayout
118
117
autolimits!(ax)
118
+
f
119
119
```
120
120
121
121
Makie graph plots can be made to be interactive, allowing one to drag nodes and edges. To do this, we retrieve the axis from the GraphMakie plot, and then register the interactions. **Note that this can only be done if `GLMakie` is the installed Makie backend. See the [GraphMakie docs](https://graph.makie.org/stable/#Predefined-Interactions) for more information about the types of interactions one can register.** Below is a non-interactive code example that shows how to do this:
0 commit comments