Skip to content

Commit 4791d58

Browse files
committed
try removing display
1 parent a4e2be0 commit 4791d58

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/src/model_creation/model_visualisation.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,30 +92,30 @@ It seems like a bit of the top node is cut off. Let's increase the top and botto
9292
```@example visualisation_graphs
9393
ax.yautolimitmargin = (0.3, 0.3) # defaults to (0.15, 0.15)
9494
ax.aspect = DataAspect()
95-
display(f)
95+
f
9696
```
9797

9898
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.
9999
```@example visualisation_graphs
100100
f, ax, p = plot_complexes(brusselator, show_rate_labels = true, node_color = :yellow, ilabels_fontsize = 10)
101101
ax.title = "Brusselator"
102-
display(f)
102+
f
103103
```
104104

105105
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/).
106106

107107
Once a graph is already created we can also change the keyword arguments by modifying the fields of the `Plot` object `p`.
108108
```@example visualisation_graphs
109109
p.node_color = :orange
110-
display(f)
110+
f
111111
```
112112

113113
Custom node positions can also be given, if the automatic layout is unsatisfactory.
114114
```@example visualisation_graphs
115115
fixedlayout = [(0,0), (1,0), (0,1), (1,1), (2,0)]
116116
p.layout = fixedlayout
117117
autolimits!(ax)
118-
display(f)
118+
f
119119
```
120120

121121
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

Comments
 (0)