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/index.md
+17
Original file line number
Diff line number
Diff line change
@@ -104,6 +104,23 @@ nothing #hide
104
104
```
105
105

106
106
107
+
## Aligning Layouts
108
+
109
+
Any two-dimensional layout can have its principal axis aligned along a desired angle (default, zero angle), by nesting an "inner" layout into an [`Align`](@ref) layout.
110
+
For example, we may align the above `Spring` layout of the small cubical graph along the horizontal or vertical axes:
111
+
112
+
```@docs
113
+
Align
114
+
```
115
+
```@example layouts
116
+
g = smallgraph(:cubical)
117
+
layout = Spring(Ptype=Float32)
118
+
f, ax, p = graphplot(g, layout=layout) # horizontal alignment (zero-angle by default)
119
+
hidedecorations!(ax); hidespines!(ax); ax.aspect = DataAspect(); f #hide
120
+
f, ax, p = graphplot(g, layout=Align(layout, pi/2)) # vertical alignment
121
+
hidedecorations!(ax); hidespines!(ax); ax.aspect = DataAspect(); f #hide
0 commit comments