rename series_permutation -> permute
This commit is contained in:
parent
41e3721018
commit
9e520242b9
@ -400,7 +400,7 @@ const _series_defaults = KW(
|
|||||||
:stride => (1, 1), # array stride for wireframe/surface, the first element is the row stride and the second is the column stride.
|
:stride => (1, 1), # array stride for wireframe/surface, the first element is the row stride and the second is the column stride.
|
||||||
:connections => nothing, # tuple of arrays to specifiy connectivity of a 3d mesh
|
:connections => nothing, # tuple of arrays to specifiy connectivity of a 3d mesh
|
||||||
:z_order => :front, # one of :front, :back or integer in 1:length(sp.series_list)
|
:z_order => :front, # one of :front, :back or integer in 1:length(sp.series_list)
|
||||||
:series_permutation => :none, # tuple of two symbols to be permuted
|
:permute => :none, # tuple of two symbols to be permuted
|
||||||
:extra_kwargs => Dict(),
|
:extra_kwargs => Dict(),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@ -676,8 +676,8 @@ end
|
|||||||
# whenever we have discrete values, we automatically set the ticks to match.
|
# whenever we have discrete values, we automatically set the ticks to match.
|
||||||
# we return (continuous_value, discrete_index)
|
# we return (continuous_value, discrete_index)
|
||||||
function discrete_value!(plotattributes, letter::Symbol, dv)
|
function discrete_value!(plotattributes, letter::Symbol, dv)
|
||||||
l = if plotattributes[:series_permutation] !== :none
|
l = if plotattributes[:permute] !== :none
|
||||||
only(filter(!=(letter), plotattributes[:series_permutation]))
|
only(filter(!=(letter), plotattributes[:permute]))
|
||||||
else
|
else
|
||||||
letter
|
letter
|
||||||
end
|
end
|
||||||
|
|||||||
@ -241,7 +241,7 @@ const _base_supported_args = [
|
|||||||
:projection,
|
:projection,
|
||||||
:show_empty_bins,
|
:show_empty_bins,
|
||||||
:z_order,
|
:z_order,
|
||||||
:series_permutation,
|
:permute,
|
||||||
]
|
]
|
||||||
|
|
||||||
function merge_with_base_supported(v::AVec)
|
function merge_with_base_supported(v::AVec)
|
||||||
@ -949,7 +949,7 @@ const _unicodeplots_seriestype = [
|
|||||||
:heatmap,
|
:heatmap,
|
||||||
:contour,
|
:contour,
|
||||||
# :contour3d,
|
# :contour3d,
|
||||||
:series_permutation,
|
:permute,
|
||||||
:spy,
|
:spy,
|
||||||
:surface,
|
:surface,
|
||||||
:wireframe,
|
:wireframe,
|
||||||
@ -1024,7 +1024,6 @@ const _hdf5_attr = merge_with_base_supported([
|
|||||||
:titlelocation,
|
:titlelocation,
|
||||||
:titlefont,
|
:titlefont,
|
||||||
:window_title,
|
:window_title,
|
||||||
:series_permutation,
|
|
||||||
:guide,
|
:guide,
|
||||||
:lims,
|
:lims,
|
||||||
:ticks,
|
:ticks,
|
||||||
@ -1127,7 +1126,6 @@ const _inspectdr_attr = merge_with_base_supported([
|
|||||||
:window_title,
|
:window_title,
|
||||||
:guide,
|
:guide,
|
||||||
:lims,
|
:lims,
|
||||||
:series_permutation,
|
|
||||||
:scale, #:ticks, :flip, :rotation,
|
:scale, #:ticks, :flip, :rotation,
|
||||||
:titlefontfamily,
|
:titlefontfamily,
|
||||||
:titlefontsize,
|
:titlefontsize,
|
||||||
@ -1231,7 +1229,6 @@ const _pgfplotsx_attr = merge_with_base_supported([
|
|||||||
:lims,
|
:lims,
|
||||||
:ticks,
|
:ticks,
|
||||||
:scale,
|
:scale,
|
||||||
:series_permutation,
|
|
||||||
:flip,
|
:flip,
|
||||||
:titlefontfamily,
|
:titlefontfamily,
|
||||||
:titlefontsize,
|
:titlefontsize,
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
const _deprecated_attributes = Dict{Symbol, Symbol}(:orientation => :series_permutation)
|
const _deprecated_attributes = Dict{Symbol, Symbol}(:orientation => :permute)
|
||||||
const _all_defaults = KW[_series_defaults, _plot_defaults, _subplot_defaults]
|
const _all_defaults = KW[_series_defaults, _plot_defaults, _subplot_defaults]
|
||||||
|
|
||||||
const _initial_defaults = deepcopy(_all_defaults)
|
const _initial_defaults = deepcopy(_all_defaults)
|
||||||
|
|||||||
@ -68,8 +68,8 @@ end
|
|||||||
function _preprocess_userrecipe(kw::AKW)
|
function _preprocess_userrecipe(kw::AKW)
|
||||||
_add_markershape(kw)
|
_add_markershape(kw)
|
||||||
|
|
||||||
if get(kw, :series_permutation, default(:series_permutation)) != :none
|
if get(kw, :permute, default(:permute)) != :none
|
||||||
l1, l2 = kw[:series_permutation]
|
l1, l2 = kw[:permute]
|
||||||
for k in _axis_args
|
for k in _axis_args
|
||||||
k1 = _attrsymbolcache[l1][k]
|
k1 = _attrsymbolcache[l1][k]
|
||||||
k2 = _attrsymbolcache[l2][k]
|
k2 = _attrsymbolcache[l2][k]
|
||||||
@ -349,8 +349,8 @@ RecipesPipeline.is_seriestype_supported(plt::Plot, st) = is_seriestype_supported
|
|||||||
|
|
||||||
function RecipesPipeline.add_series!(plt::Plot, plotattributes)
|
function RecipesPipeline.add_series!(plt::Plot, plotattributes)
|
||||||
sp = _prepare_subplot(plt, plotattributes)
|
sp = _prepare_subplot(plt, plotattributes)
|
||||||
if plotattributes[:series_permutation] != :none
|
if plotattributes[:permute] != :none
|
||||||
letter1, letter2 = plotattributes[:series_permutation]
|
letter1, letter2 = plotattributes[:permute]
|
||||||
plotattributes[letter1], plotattributes[letter2] =
|
plotattributes[letter1], plotattributes[letter2] =
|
||||||
plotattributes[letter2], plotattributes[letter1]
|
plotattributes[letter2], plotattributes[letter1]
|
||||||
end
|
end
|
||||||
|
|||||||
@ -19,7 +19,7 @@ end
|
|||||||
|
|
||||||
@testset "Permute recipes" begin
|
@testset "Permute recipes" begin
|
||||||
pl = bar(["a", "b", "c"], [1, 2, 3])
|
pl = bar(["a", "b", "c"], [1, 2, 3])
|
||||||
ppl = bar(["a", "b", "c"], [1, 2, 3], series_permutation = (:x, :y))
|
ppl = bar(["a", "b", "c"], [1, 2, 3], permute = (:x, :y))
|
||||||
@test xticks(ppl) == yticks(pl)
|
@test xticks(ppl) == yticks(pl)
|
||||||
@test yticks(ppl) == xticks(pl)
|
@test yticks(ppl) == xticks(pl)
|
||||||
@test filter(isfinite, pl[1][1][:x]) == filter(isfinite, ppl[1][1][:y])
|
@test filter(isfinite, pl[1][1][:x]) == filter(isfinite, ppl[1][1][:y])
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user