Skip to content

Commit a4e2be0

Browse files
committed
fix graph defaults
1 parent fc01791 commit a4e2be0

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

Project.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,13 @@ BifurcationKit = "0f109fa4-8a5d-4b75-95aa-f515264e7665"
3232
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
3333
GraphMakie = "1ecd5474-83a3-4783-bb4f-06765db800d2"
3434
HomotopyContinuation = "f213a82b-91d6-5c5d-acf7-10f1c761b327"
35+
Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a"
3536
NetworkLayout = "46757867-2c16-5918-afeb-47bfcb05e46a"
3637

3738
[extensions]
3839
CatalystBifurcationKitExtension = "BifurcationKit"
3940
CatalystCairoMakieExtension = "CairoMakie"
40-
CatalystGraphMakieExtension = ["GraphMakie", "NetworkLayout"]
41+
CatalystGraphMakieExtension = ["GraphMakie", "NetworkLayout", "Makie"]
4142
CatalystHomotopyContinuationExtension = "HomotopyContinuation"
4243

4344
[compat]
@@ -56,6 +57,7 @@ JumpProcesses = "9.13.2"
5657
LaTeXStrings = "1.3.0"
5758
Latexify = "0.16.6"
5859
MacroTools = "0.5.5"
60+
Makie = "0.22.1"
5961
ModelingToolkit = "< 9.60"
6062
NetworkLayout = "0.4.7"
6163
Parameters = "0.12"

docs/src/model_creation/model_visualisation.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,18 +88,16 @@ In this section we demonstrate some of the ways that plot objects can be manipul
8888
f, ax, p = plot_complexes(brusselator, show_rate_labels = true)
8989
```
9090

91-
It seems like a bit of the top node is cut off. Let's show 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`.
9292
```@example visualisation_graphs
93-
showdecorations!(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)
9594
ax.aspect = DataAspect()
96-
display(F)
95+
display(f)
9796
```
9897

9998
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.
10099
```@example visualisation_graphs
101100
f, ax, p = plot_complexes(brusselator, show_rate_labels = true, node_color = :yellow, ilabels_fontsize = 10)
102-
ax.aspect = DataAspect()
103101
ax.title = "Brusselator"
104102
display(f)
105103
```

ext/CatalystGraphMakieExtension.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module CatalystGraphMakieExtension
22

33
# Fetch packages.
4-
using Catalyst, GraphMakie, Graphs, Symbolics, SparseArrays, NetworkLayout
4+
using Catalyst, GraphMakie, Graphs, Symbolics, SparseArrays, NetworkLayout, Makie
55
using Symbolics: get_variables!
66
import Catalyst: species_reaction_graph, incidencematgraph, lattice_plot, lattice_animation
77

ext/CatalystGraphMakieExtension/rn_graph_plot.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ function Catalyst.plot_network(rn::ReactionSystem; kwargs...)
210210
f.axis.xautolimitmargin = (0.15, 0.15)
211211
f.axis.yautolimitmargin = (0.15, 0.15)
212212
hidedecorations!(f.axis)
213+
hidespines!(f.axis)
213214
f.axis.aspect = DataAspect()
214215

215216
f
@@ -266,8 +267,9 @@ function Catalyst.plot_complexes(rn::ReactionSystem; show_rate_labels = false, k
266267
f.axis.xautolimitmargin = (0.15, 0.15)
267268
f.axis.yautolimitmargin = (0.15, 0.15)
268269
hidedecorations!(f.axis)
270+
hidespines!(f.axis)
269271
f.axis.aspect = DataAspect()
270-
272+
271273
f
272274
end
273275

0 commit comments

Comments
 (0)