Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add permute, deprecate orientation #4164

Merged
merged 16 commits into from
May 5, 2022
Merged
1 change: 1 addition & 0 deletions src/args.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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.
: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
:extra_kwargs => Dict(),
)

Expand Down
5 changes: 5 additions & 0 deletions src/backends.jl
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ const _base_supported_args = [
:projection,
:show_empty_bins,
:z_order,
:series_permutation,
]

function merge_with_base_supported(v::AVec)
Expand Down Expand Up @@ -948,6 +949,7 @@ const _unicodeplots_seriestype = [
:heatmap,
:contour,
# :contour3d,
:series_permutation,
:spy,
:surface,
:wireframe,
Expand Down Expand Up @@ -1022,6 +1024,7 @@ const _hdf5_attr = merge_with_base_supported([
:titlelocation,
:titlefont,
:window_title,
:series_permutation,
:guide,
:lims,
:ticks,
Expand Down Expand Up @@ -1124,6 +1127,7 @@ const _inspectdr_attr = merge_with_base_supported([
:window_title,
:guide,
:lims,
:series_permutation,
:scale, #:ticks, :flip, :rotation,
:titlefontfamily,
:titlefontsize,
Expand Down Expand Up @@ -1227,6 +1231,7 @@ const _pgfplotsx_attr = merge_with_base_supported([
:lims,
:ticks,
:scale,
:series_permutation,
:flip,
:titlefontfamily,
:titlefontsize,
Expand Down
4 changes: 4 additions & 0 deletions src/pipeline.jl
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,10 @@ 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]
plotattributes[letter1], plotattributes[letter2] = plotattributes[letter2], plotattributes[letter1]
BeastyBlacksmith marked this conversation as resolved.
Show resolved Hide resolved
BeastyBlacksmith marked this conversation as resolved.
Show resolved Hide resolved
end
_expand_subplot_extrema(sp, plotattributes, plotattributes[:seriestype])
_update_series_attributes!(plotattributes, plt, sp)
_add_the_series(plt, sp, plotattributes)
Expand Down