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.
|
||||
: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)
|
||||
:series_permutation => :none, # tuple of two symbols to be permuted
|
||||
:permute => :none, # tuple of two symbols to be permuted
|
||||
:extra_kwargs => Dict(),
|
||||
)
|
||||
|
||||
|
||||
@ -676,8 +676,8 @@ end
|
||||
# whenever we have discrete values, we automatically set the ticks to match.
|
||||
# we return (continuous_value, discrete_index)
|
||||
function discrete_value!(plotattributes, letter::Symbol, dv)
|
||||
l = if plotattributes[:series_permutation] !== :none
|
||||
only(filter(!=(letter), plotattributes[:series_permutation]))
|
||||
l = if plotattributes[:permute] !== :none
|
||||
only(filter(!=(letter), plotattributes[:permute]))
|
||||
else
|
||||
letter
|
||||
end
|
||||
|
||||
@ -241,7 +241,7 @@ const _base_supported_args = [
|
||||
:projection,
|
||||
:show_empty_bins,
|
||||
:z_order,
|
||||
:series_permutation,
|
||||
:permute,
|
||||
]
|
||||
|
||||
function merge_with_base_supported(v::AVec)
|
||||
@ -949,7 +949,7 @@ const _unicodeplots_seriestype = [
|
||||
:heatmap,
|
||||
:contour,
|
||||
# :contour3d,
|
||||
:series_permutation,
|
||||
:permute,
|
||||
:spy,
|
||||
:surface,
|
||||
:wireframe,
|
||||
@ -1024,7 +1024,6 @@ const _hdf5_attr = merge_with_base_supported([
|
||||
:titlelocation,
|
||||
:titlefont,
|
||||
:window_title,
|
||||
:series_permutation,
|
||||
:guide,
|
||||
:lims,
|
||||
:ticks,
|
||||
@ -1127,7 +1126,6 @@ const _inspectdr_attr = merge_with_base_supported([
|
||||
:window_title,
|
||||
:guide,
|
||||
:lims,
|
||||
:series_permutation,
|
||||
:scale, #:ticks, :flip, :rotation,
|
||||
:titlefontfamily,
|
||||
:titlefontsize,
|
||||
@ -1231,7 +1229,6 @@ const _pgfplotsx_attr = merge_with_base_supported([
|
||||
:lims,
|
||||
:ticks,
|
||||
:scale,
|
||||
:series_permutation,
|
||||
:flip,
|
||||
:titlefontfamily,
|
||||
: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 _initial_defaults = deepcopy(_all_defaults)
|
||||
|
||||
@ -68,8 +68,8 @@ end
|
||||
function _preprocess_userrecipe(kw::AKW)
|
||||
_add_markershape(kw)
|
||||
|
||||
if get(kw, :series_permutation, default(:series_permutation)) != :none
|
||||
l1, l2 = kw[:series_permutation]
|
||||
if get(kw, :permute, default(:permute)) != :none
|
||||
l1, l2 = kw[:permute]
|
||||
for k in _axis_args
|
||||
k1 = _attrsymbolcache[l1][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)
|
||||
sp = _prepare_subplot(plt, plotattributes)
|
||||
if plotattributes[:series_permutation] != :none
|
||||
letter1, letter2 = plotattributes[:series_permutation]
|
||||
if plotattributes[:permute] != :none
|
||||
letter1, letter2 = plotattributes[:permute]
|
||||
plotattributes[letter1], plotattributes[letter2] =
|
||||
plotattributes[letter2], plotattributes[letter1]
|
||||
end
|
||||
|
||||
@ -19,7 +19,7 @@ end
|
||||
|
||||
@testset "Permute recipes" begin
|
||||
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 yticks(ppl) == xticks(pl)
|
||||
@test filter(isfinite, pl[1][1][:x]) == filter(isfinite, ppl[1][1][:y])
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user