From 9d25c8fcd48590c927890fead22b80f46ea13752 Mon Sep 17 00:00:00 2001 From: Thomas Breloff Date: Mon, 13 Jun 2016 09:27:49 -0400 Subject: [PATCH] added PLOTS_DEFAULTS env var; check isfinite in axis_limits --- src/Plots.jl | 4 ++++ src/axes.jl | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Plots.jl b/src/Plots.jl index 75bf9fa0..729d8f92 100644 --- a/src/Plots.jl +++ b/src/Plots.jl @@ -241,6 +241,10 @@ const CURRENT_BACKEND = CurrentBackend(:none) function __init__() setup_ijulia() setup_atom() + + if haskey(ENV, "PLOTS_DEFAULTS") + default(; ENV["PLOTS_DEFAULTS"]...) + end end # --------------------------------------------------------- diff --git a/src/axes.jl b/src/axes.jl index 66c30bc1..a2e409b8 100644 --- a/src/axes.jl +++ b/src/axes.jl @@ -246,7 +246,7 @@ function axis_limits(axis::Axis, should_widen::Bool = default_should_widen(axis) amax = lims[2] end end - if amax <= amin + if amax <= amin && isfinite(amin) amax = amin + 1.0 end if should_widen