add series_permutation

This commit is contained in:
Simon Christ 2022-04-01 10:58:56 +02:00
parent caf4d1857c
commit 3886082ccd
3 changed files with 10 additions and 0 deletions

View File

@ -400,6 +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
:extra_kwargs => Dict(), :extra_kwargs => Dict(),
) )

View File

@ -241,6 +241,7 @@ const _base_supported_args = [
:projection, :projection,
:show_empty_bins, :show_empty_bins,
:z_order, :z_order,
:series_permutation,
] ]
function merge_with_base_supported(v::AVec) function merge_with_base_supported(v::AVec)
@ -948,6 +949,7 @@ const _unicodeplots_seriestype = [
:heatmap, :heatmap,
:contour, :contour,
# :contour3d, # :contour3d,
:series_permutation,
:spy, :spy,
:surface, :surface,
:wireframe, :wireframe,
@ -1022,6 +1024,7 @@ const _hdf5_attr = merge_with_base_supported([
:titlelocation, :titlelocation,
:titlefont, :titlefont,
:window_title, :window_title,
:series_permutation,
:guide, :guide,
:lims, :lims,
:ticks, :ticks,
@ -1124,6 +1127,7 @@ 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,
@ -1227,6 +1231,7 @@ const _pgfplotsx_attr = merge_with_base_supported([
:lims, :lims,
:ticks, :ticks,
:scale, :scale,
:series_permutation,
:flip, :flip,
:titlefontfamily, :titlefontfamily,
:titlefontsize, :titlefontsize,

View File

@ -338,6 +338,10 @@ 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
letter1, letter2 = plotattributes[:series_permutation]
plotattributes[letter1], plotattributes[letter2] = plotattributes[letter2], plotattributes[letter1]
end
_expand_subplot_extrema(sp, plotattributes, plotattributes[:seriestype]) _expand_subplot_extrema(sp, plotattributes, plotattributes[:seriestype])
_update_series_attributes!(plotattributes, plt, sp) _update_series_attributes!(plotattributes, plt, sp)
_add_the_series(plt, sp, plotattributes) _add_the_series(plt, sp, plotattributes)