Added a Date & DateTime method for widen - enables xlims with Date or DateTime types
This commit is contained in:
parent
c35adbfeff
commit
b046ed9b90
11
src/axes.jl
11
src/axes.jl
@ -426,6 +426,11 @@ end
|
|||||||
|
|
||||||
# -------------------------------------------------------------------------
|
# -------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# handle widen in the case that xlims are of type Date or DateTime
|
||||||
|
function widen(dmin::Union{Date,DateTime}, dmax::Union{Date,DateTime}, scale = :identity)
|
||||||
|
widen(Dates.value(dmin), Dates.value(dmax), scale)
|
||||||
|
end
|
||||||
|
|
||||||
# push the limits out slightly
|
# push the limits out slightly
|
||||||
function widen(lmin, lmax, scale = :identity)
|
function widen(lmin, lmax, scale = :identity)
|
||||||
f, invf = RecipesPipeline.scale_func(scale), RecipesPipeline.inverse_scale_func(scale)
|
f, invf = RecipesPipeline.scale_func(scale), RecipesPipeline.inverse_scale_func(scale)
|
||||||
@ -674,7 +679,7 @@ function axis_drawing_info(sp, letter)
|
|||||||
reverse_if((tick, tick_stop), isy),
|
reverse_if((tick, tick_stop), isy),
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
if ax[:minorgrid]
|
if ax[:minorgrid]
|
||||||
push!(
|
push!(
|
||||||
minorgrid_segments,
|
minorgrid_segments,
|
||||||
reverse_if((tick, oamin), isy),
|
reverse_if((tick, oamin), isy),
|
||||||
@ -728,7 +733,7 @@ function axis_drawing_info_3d(sp, letter)
|
|||||||
minorgrid_segments = Segments(3)
|
minorgrid_segments = Segments(3)
|
||||||
border_segments = Segments(3)
|
border_segments = Segments(3)
|
||||||
|
|
||||||
|
|
||||||
if sp[:framestyle] != :none# && letter === :x
|
if sp[:framestyle] != :none# && letter === :x
|
||||||
na0, na1 = if sp[:framestyle] in (:origin, :zerolines)
|
na0, na1 = if sp[:framestyle] in (:origin, :zerolines)
|
||||||
0, 0
|
0, 0
|
||||||
@ -847,4 +852,4 @@ end
|
|||||||
reverse_if(x, cond) = cond ? reverse(x) : x
|
reverse_if(x, cond) = cond ? reverse(x) : x
|
||||||
axis_tuple(x, y, letter) = reverse_if((x, y), letter === :y)
|
axis_tuple(x, y, letter) = reverse_if((x, y), letter === :y)
|
||||||
|
|
||||||
axes_shift(t, i) = i % 3 == 0 ? t : i % 3 == 1 ? (t[3], t[1], t[2]) : (t[2], t[3], t[1])
|
axes_shift(t, i) = i % 3 == 0 ? t : i % 3 == 1 ? (t[3], t[1], t[2]) : (t[2], t[3], t[1])
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user