Merge branch 'master' of https://github.com/JuliaPlots/Plots.jl into wire
This commit is contained in:
commit
4ac78623b5
@ -1,7 +1,7 @@
|
|||||||
name = "Plots"
|
name = "Plots"
|
||||||
uuid = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
|
uuid = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
|
||||||
author = ["Tom Breloff (@tbreloff)"]
|
author = ["Tom Breloff (@tbreloff)"]
|
||||||
version = "1.16.5"
|
version = "1.16.6"
|
||||||
|
|
||||||
[deps]
|
[deps]
|
||||||
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
|
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
|
||||||
|
|||||||
133
src/axes.jl
133
src/axes.jl
@ -703,62 +703,47 @@ function axis_drawing_info(sp, letter)
|
|||||||
)
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if !(ax[:ticks] in (:none, nothing, false))
|
if ax[:ticks] ∉ (:none, nothing, false)
|
||||||
f = RecipesPipeline.scale_func(oax[:scale])
|
f = RecipesPipeline.scale_func(oax[:scale])
|
||||||
invf = RecipesPipeline.inverse_scale_func(oax[:scale])
|
invf = RecipesPipeline.inverse_scale_func(oax[:scale])
|
||||||
if ax[:tick_direction] !== :none
|
|
||||||
tick_start, tick_stop = if sp[:framestyle] == :origin
|
|
||||||
t = invf(f(0) + 0.012 * (f(oamax) - f(oamin)))
|
|
||||||
(-t, t)
|
|
||||||
else
|
|
||||||
ticks_in = ax[:tick_direction] == :out ? -1 : 1
|
|
||||||
t = invf(f(oa1) + 0.012 * (f(oa2) - f(oa1)) * ticks_in)
|
|
||||||
(oa1, t)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
for tick in ticks[1]
|
add_major_or_minor_segments(ticks, grid, segments, factor, cond) = begin
|
||||||
if ax[:showaxis] && ax[:tick_direction] !== :none
|
if cond
|
||||||
push!(
|
tick_start, tick_stop = if sp[:framestyle] == :origin
|
||||||
tick_segments,
|
t = invf(f(0) + factor * (f(oamax) - f(oamin)))
|
||||||
reverse_if((tick, tick_start), isy),
|
(-t, t)
|
||||||
reverse_if((tick, tick_stop), isy),
|
else
|
||||||
)
|
ticks_in = ax[:tick_direction] == :out ? -1 : 1
|
||||||
|
t = invf(f(oa1) + factor * (f(oa2) - f(oa1)) * ticks_in)
|
||||||
|
(oa1, t)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
if ax[:grid]
|
|
||||||
push!(
|
|
||||||
grid_segments,
|
|
||||||
reverse_if((tick, oamin), isy),
|
|
||||||
reverse_if((tick, oamax), isy),
|
|
||||||
)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
if !(ax[:minorticks] in (:none, nothing, false)) || ax[:minorgrid]
|
for tick in ticks
|
||||||
tick_start, tick_stop = if sp[:framestyle] == :origin
|
if ax[:showaxis] && cond
|
||||||
t = invf(f(0) + 0.006 * (f(oamax) - f(oamin)))
|
|
||||||
(-t, t)
|
|
||||||
else
|
|
||||||
t = invf(f(oa1) + 0.006 * (f(oa2) - f(oa1)) * ticks_in)
|
|
||||||
(oa1, t)
|
|
||||||
end
|
|
||||||
for tick in minor_ticks
|
|
||||||
if ax[:showaxis]
|
|
||||||
push!(
|
push!(
|
||||||
tick_segments,
|
tick_segments,
|
||||||
reverse_if((tick, tick_start), isy),
|
reverse_if((tick, tick_start), isy),
|
||||||
reverse_if((tick, tick_stop), isy),
|
reverse_if((tick, tick_stop), isy),
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
if ax[:minorgrid]
|
if grid
|
||||||
push!(
|
push!(
|
||||||
minorgrid_segments,
|
segments,
|
||||||
reverse_if((tick, oamin), isy),
|
reverse_if((tick, oamin), isy),
|
||||||
reverse_if((tick, oamax), isy),
|
reverse_if((tick, oamax), isy),
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# add major grid segments
|
||||||
|
add_major_or_minor_segments(ticks[1], ax[:grid], grid_segments, 0.012, ax[:tick_direction] !== :none)
|
||||||
|
|
||||||
|
# add minor grid segments
|
||||||
|
if ax[:minorticks] ∉ (:none, nothing, false) || ax[:minorgrid]
|
||||||
|
add_major_or_minor_segments(minor_ticks, ax[:minorgrid], minorgrid_segments, 0.006, true)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -841,74 +826,54 @@ function axis_drawing_info_3d(sp, letter)
|
|||||||
)
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
# TODO this can be simplified, we do almost the same thing twice for grid and minorgrid
|
|
||||||
if !(ax[:ticks] in (:none, nothing, false))
|
if ax[:ticks] ∉ (:none, nothing, false)
|
||||||
f = RecipesPipeline.scale_func(nax[:scale])
|
f = RecipesPipeline.scale_func(nax[:scale])
|
||||||
invf = RecipesPipeline.inverse_scale_func(nax[:scale])
|
invf = RecipesPipeline.inverse_scale_func(nax[:scale])
|
||||||
if ax[:tick_direction] !== :none
|
|
||||||
tick_start, tick_stop = if sp[:framestyle] == :origin
|
|
||||||
t = invf(f(0) + 0.012 * (f(namax) - f(namin)))
|
|
||||||
(-t, t)
|
|
||||||
else
|
|
||||||
ticks_in = ax[:tick_direction] == :out ? -1 : 1
|
|
||||||
t = invf(f(na0) + 0.012 * (f(na1) - f(na0)) * ticks_in)
|
|
||||||
(na0, t)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
ga0, ga1 = sp[:framestyle] in (:origin, :zerolines) ? (namin, namax) : (na0, na1)
|
ga0, ga1 = sp[:framestyle] in (:origin, :zerolines) ? (namin, namax) : (na0, na1)
|
||||||
for tick in ticks[1]
|
|
||||||
if ax[:showaxis] && ax[:tick_direction] !== :none
|
|
||||||
push!(
|
|
||||||
tick_segments,
|
|
||||||
sort_3d_axes(tick, tick_start, fa0, letter),
|
|
||||||
sort_3d_axes(tick, tick_stop, fa0, letter),
|
|
||||||
)
|
|
||||||
end
|
|
||||||
if ax[:grid]
|
|
||||||
push!(
|
|
||||||
grid_segments,
|
|
||||||
sort_3d_axes(tick, ga0, fa0, letter),
|
|
||||||
sort_3d_axes(tick, ga1, fa0, letter),
|
|
||||||
)
|
|
||||||
push!(
|
|
||||||
grid_segments,
|
|
||||||
sort_3d_axes(tick, ga1, fa0, letter),
|
|
||||||
sort_3d_axes(tick, ga1, fa1, letter),
|
|
||||||
)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
if !(ax[:minorticks] in (:none, nothing, false)) || ax[:minorgrid]
|
add_major_or_minor_segments(ticks, grid, segments, factor, cond) = begin
|
||||||
tick_start, tick_stop = if sp[:framestyle] == :origin
|
if cond
|
||||||
t = invf(f(0) + 0.006 * (f(namax) - f(namin)))
|
tick_start, tick_stop = if sp[:framestyle] == :origin
|
||||||
(-t, t)
|
t = invf(f(0) + factor * (f(namax) - f(namin)))
|
||||||
else
|
(-t, t)
|
||||||
t = invf(f(na0) + 0.006 * (f(na1) - f(na0)) * ticks_in)
|
else
|
||||||
(na0, t)
|
ticks_in = ax[:tick_direction] == :out ? -1 : 1
|
||||||
|
t = invf(f(na0) + factor * (f(na1) - f(na0)) * ticks_in)
|
||||||
|
(na0, t)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
for tick in minor_ticks
|
|
||||||
if ax[:showaxis] && ax[:tick_direction] !== :none
|
for tick in ticks
|
||||||
|
if ax[:showaxis] && cond
|
||||||
push!(
|
push!(
|
||||||
tick_segments,
|
tick_segments,
|
||||||
sort_3d_axes(tick, tick_start, fa0, letter),
|
sort_3d_axes(tick, tick_start, fa0, letter),
|
||||||
sort_3d_axes(tick, tick_stop, fa0, letter),
|
sort_3d_axes(tick, tick_stop, fa0, letter),
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
if ax[:minorgrid]
|
if grid
|
||||||
push!(
|
push!(
|
||||||
minorgrid_segments,
|
segments,
|
||||||
sort_3d_axes(tick, ga0, fa0, letter),
|
sort_3d_axes(tick, ga0, fa0, letter),
|
||||||
sort_3d_axes(tick, ga1, fa0, letter),
|
sort_3d_axes(tick, ga1, fa0, letter),
|
||||||
)
|
)
|
||||||
push!(
|
push!(
|
||||||
minorgrid_segments,
|
segments,
|
||||||
sort_3d_axes(tick, ga1, fa0, letter),
|
sort_3d_axes(tick, ga1, fa0, letter),
|
||||||
sort_3d_axes(tick, ga1, fa1, letter),
|
sort_3d_axes(tick, ga1, fa1, letter),
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# add major grid segments
|
||||||
|
add_major_or_minor_segments(ticks[1], ax[:grid], grid_segments, 0.012, ax[:tick_direction] !== :none)
|
||||||
|
|
||||||
|
# add minor grid segments
|
||||||
|
if ax[:minorticks] ∉ (:none, nothing, false) || ax[:minorgrid]
|
||||||
|
add_major_or_minor_segments(minor_ticks, ax[:minorgrid], minorgrid_segments, 0.006, true)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -406,7 +406,7 @@ end
|
|||||||
|
|
||||||
# ----------------------------------------------------------------------
|
# ----------------------------------------------------------------------
|
||||||
|
|
||||||
calc_num_subplots(layout::AbstractLayout) = 1
|
calc_num_subplots(layout::AbstractLayout) = get(layout.attr, :blank, false) ? 0 : 1
|
||||||
function calc_num_subplots(layout::GridLayout)
|
function calc_num_subplots(layout::GridLayout)
|
||||||
tot = 0
|
tot = 0
|
||||||
for l in layout.grid
|
for l in layout.grid
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user