diff --git a/Project.toml b/Project.toml index 6c42045..dd0f78c 100644 --- a/Project.toml +++ b/Project.toml @@ -7,6 +7,7 @@ version = "0.0.10" EcologicalNetworks = "f03a62fe-f8ab-5b77-a061-bb599b765229" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01" +SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91" diff --git a/src/EcologicalNetworksPlots.jl b/src/EcologicalNetworksPlots.jl index 8528122..5ed1a60 100644 --- a/src/EcologicalNetworksPlots.jl +++ b/src/EcologicalNetworksPlots.jl @@ -4,6 +4,7 @@ using EcologicalNetworks using RecipesBase using StatsBase using Statistics +using SparseArrays # Various layout manipulation functions include(joinpath(".", "utilities.jl")) diff --git a/src/recipes.jl b/src/recipes.jl index 564a0e6..436490d 100644 --- a/src/recipes.jl +++ b/src/recipes.jl @@ -22,7 +22,11 @@ end legend --> false if typeof(network) <: QuantitativeNetwork - int_range = (minimum(filter(x -> x > 0.0, network.A)), maximum(network.A)) + if hasfield(T, :A) + int_range = (minimum(filter(x -> x > 0.0, network.A)), maximum(network.A)) + else + int_range = extrema(network.edges.nzval) + end end if get(plotattributes, :seriestype, :plot) == :plot