Add a check for ticks==nothing or false

Fixes #1336
This commit is contained in:
Will Kearney 2018-01-06 14:54:57 -05:00
parent 1949b6fe0f
commit e6df4d977d

View File

@ -552,7 +552,7 @@ function axis_drawing_info(sp::Subplot)
end end
push!(xaxis_segs, (xmin, y1), (xmax, y1)) push!(xaxis_segs, (xmin, y1), (xmax, y1))
# don't show the 0 tick label for the origin framestyle # don't show the 0 tick label for the origin framestyle
if sp[:framestyle] == :origin && length(xticks) > 1 if sp[:framestyle] == :origin && !(xticks in (nothing,false)) && length(xticks) > 1
showticks = xticks[1] .!= 0 showticks = xticks[1] .!= 0
xticks = (xticks[1][showticks], xticks[2][showticks]) xticks = (xticks[1][showticks], xticks[2][showticks])
end end
@ -591,7 +591,7 @@ function axis_drawing_info(sp::Subplot)
end end
push!(yaxis_segs, (x1, ymin), (x1, ymax)) push!(yaxis_segs, (x1, ymin), (x1, ymax))
# don't show the 0 tick label for the origin framestyle # don't show the 0 tick label for the origin framestyle
if sp[:framestyle] == :origin && length(yticks) > 1 if sp[:framestyle] == :origin && !(yticks in (nothing,false)) && length(yticks) > 1
showticks = yticks[1] .!= 0 showticks = yticks[1] .!= 0
yticks = (yticks[1][showticks], yticks[2][showticks]) yticks = (yticks[1][showticks], yticks[2][showticks])
end end