setTicksFromStringVector fixes; travis

This commit is contained in:
Thomas Breloff 2016-05-09 14:36:09 -04:00
parent 17a90e3b00
commit 7bee9a5829
3 changed files with 13 additions and 4 deletions

View File

@ -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

View File

@ -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)

View File

@ -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")