diff --git a/src/plot.jl b/src/plot.jl index 6eba9dec..5c53111f 100644 --- a/src/plot.jl +++ b/src/plot.jl @@ -227,6 +227,7 @@ function setTicksFromStringVector(plt::Plot, d::KW, di::KW, letter) # do we really want to do this? typeof(v) <: AbstractArray || return + isempty(v) && return trueOrAllTrue(_ -> typeof(_) <: AbstractString, v) || return # compute the ticks and labels @@ -234,7 +235,12 @@ function setTicksFromStringVector(plt::Plot, d::KW, di::KW, letter) # extend the existing ticks and labels. only add to labels if they're new! ticks, labels = pargs[ticksym] newlabels = filter(_ -> !(_ in labels), unique(v)) - ticks = vcat(ticks, maximum(ticks) + (1:length(newlabels))) + newticks = if isempty(ticks) + collect(1:length(newlabels)) + else + maximum(ticks) + collect(1:length(newlabels)) + end + ticks = vcat(ticks, newticks) labels = vcat(labels, newlabels) ticks, labels else diff --git a/src/subplot.jl b/src/subplot.jl index 14c2f69b..34e2035c 100644 --- a/src/subplot.jl +++ b/src/subplot.jl @@ -232,8 +232,11 @@ end # given a fully processed KW, add the series to the Plot function _add_series_subplot(plt::Plot, d::KW) - setTicksFromStringVector(d, d, :x, :xticks) - setTicksFromStringVector(d, d, :y, :yticks) + # setTicksFromStringVector(d, d, :x, :xticks) + # setTicksFromStringVector(d, d, :y, :yticks) + setTicksFromStringVector(plt, d, d, "x") + setTicksFromStringVector(plt, d, d, "y") + setTicksFromStringVector(plt, d, d, "z") # this is the actual call to the backend _add_series(plt.backend, plt, d) diff --git a/test/travis_commands.jl b/test/travis_commands.jl index 6ee79fc5..d0b774d7 100644 --- a/test/travis_commands.jl +++ b/test/travis_commands.jl @@ -7,7 +7,7 @@ Pkg.build("ImageMagick") Pkg.clone("GR") Pkg.build("GR") -Pkg.clone("https://github.com/JuliaPlots/RecipesBase.jl.git") +# Pkg.clone("https://github.com/JuliaPlots/RecipesBase.jl.git") Pkg.clone("https://github.com/tbreloff/ExamplePlots.jl.git"); # Pkg.clone("https://github.com/JunoLab/Blink.jl.git")