commit c0197122604cd76fc10c2000f11815191c4d542e
parent 69b0d873e6ec27b9d3e9b95219640f742283445c
Author: Anders Damsgaard <andersd@riseup.net>
Date: Tue, 3 Oct 2017 14:35:09 -0400
make PyPlot optional
Diffstat:
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/REQUIRE b/REQUIRE
@@ -1,5 +1,4 @@
julia 0.6
WriteVTK
NetCDF
-PyPlot
Documenter
diff --git a/src/icefloe.jl b/src/icefloe.jl
@@ -1,5 +1,8 @@
## Manage icefloes in the model
-import PyPlot
+if typeof(Pkg.installed("PyPlot")) == VersionNumber
+ import PyPlot
+ hasPyPlot = true
+end
export addIceFloeCylindrical!
"""
@@ -694,6 +697,10 @@ function plotIceFloeSizeDistribution(simulation::Simulation;
skip_fixed::Bool = true,
log_y::Bool = true)
+ if !hasPyPlot
+ warn("Function not available because PyPlot is not installed")
+ return
+ end
diameters = Float64[]
for i=1:length(simulation.ice_floes)
if simulation.ice_floes[i].fixed && skip_fixed