diff --git a/.travis.yml b/.travis.yml index 0c620810..4ca4c6fa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,11 +4,11 @@ os: - linux - osx julia: - - release + # - release - nightly -matrix: - allow_failures: - - julia: nightly +# matrix: +# allow_failures: +# - julia: nightly # # before install: # # - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update ; fi diff --git a/src/Plots.jl b/src/Plots.jl index 27bf5d45..424b632f 100644 --- a/src/Plots.jl +++ b/src/Plots.jl @@ -34,6 +34,7 @@ export plot, plot!, + update!, current, default, diff --git a/src/utils.jl b/src/utils.jl index 0eac3360..a5f5b588 100644 --- a/src/utils.jl +++ b/src/utils.jl @@ -686,9 +686,17 @@ function push_z!(series::Series, zi) return end +function Base.push!(series::Series, yi) + x = extendSeriesByOne(series[:x]) + expand_extrema!(series[:subplot][:xaxis], x[end]) + series[:x] = x + push_y!(series, yi) +end Base.push!(series::Series, xi, yi) = (push_x!(series,xi); push_y!(series,yi)) Base.push!(series::Series, xi, yi, zi) = (push_x!(series,xi); push_y!(series,yi); push_z!(series,zi)) +# ------------------------------------------------------- + function update!(series::Series; kw...) d = KW(kw) preprocessArgs!(d) @@ -700,6 +708,20 @@ function update!(series::Series; kw...) end end _series_updated(series[:subplot].plt, series) + series +end + +function update!(sp::Subplot; kw...) + d = KW(kw) + preprocessArgs!(d) + for (k,v) in d + if haskey(_subplot_defaults, k) + sp[k] = v + else + warn("unused key $k in subplot update") + end + end + sp end # -------------------------------------------------------