Skip to content

Commit 419655a

Browse files
committed
-update locs type in gplot and spring_layout
-update default plot_size to square plot
1 parent d9716fc commit 419655a

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ gplot(h)
188188
+ `linetype` Type of line used for edges ("straight", "curve"). Default: "straight"
189189
+ `outangle` Angular width in radians for the edges (only used if `linetype = "curve`). Default: `π/5 (36 degrees)`
190190
+ `background_color` Color for the plot background. Default: `nothing`
191-
+ `plot_size` Tuple of measures for width x height of plot area. Default: `(sqrt(2)*10cm, 10cm)`
191+
+ `plot_size` Tuple of measures for width x height of plot area. Default: `(10cm, 10cm)`
192192
+ `leftpad, rightpad, toppad, bottompad` Padding for the plot margins. Default: `0mm`
193193
+ `pad` Padding for plot margins (overrides individual padding if given). Default: `nothing`
194194
# Reporting Bugs

src/layout.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ julia> locs_x, locs_y = spring_layout(g)
102102
```
103103
"""
104104
function spring_layout(g::AbstractGraph,
105-
locs_x_in::Vector{R1}=2*rand(nv(g)).-1.0,
106-
locs_y_in::Vector{R2}=2*rand(nv(g)).-1.0;
105+
locs_x_in::AbstractVector{R1}=2*rand(nv(g)).-1.0,
106+
locs_y_in::AbstractVector{R2}=2*rand(nv(g)).-1.0;
107107
C=2.0,
108108
MAXITER=100,
109109
INITTEMP=2.0) where {R1 <: Real, R2 <: Real}

src/plot.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ Default: `π/5 (36 degrees)`
110110
Color for the plot background. Default: `nothing`
111111
112112
`plot_size`
113-
Tuple of measures for width x height for plot area. Default: `(sqrt(2)*10cm, 10cm)`
113+
Tuple of measures for width x height for plot area. Default: `(10cm, 10cm)`
114114
115115
`leftpad, rightpad, toppad, bottompad`
116116
Padding for the plot margins. Default: `0mm`
@@ -119,7 +119,7 @@ Padding for the plot margins. Default: `0mm`
119119
Padding for plot margins (overrides individual padding if given). Default: `nothing`
120120
"""
121121
function gplot(g::AbstractGraph{T},
122-
locs_x_in::Vector{R1}, locs_y_in::Vector{R2};
122+
locs_x_in::AbstractVector{R1}, locs_y_in::AbstractVector{R2};
123123
title = "",
124124
title_color = colorant"black",
125125
title_size = 4.0,
@@ -149,7 +149,7 @@ function gplot(g::AbstractGraph{T},
149149
linetype = "straight",
150150
outangle = π / 5,
151151
background_color = nothing,
152-
plot_size = (sqrt(2)*10cm, 10cm),
152+
plot_size = (10cm, 10cm),
153153
leftpad = 0mm,
154154
rightpad = 0mm,
155155
toppad = 0mm,

0 commit comments

Comments
 (0)