Fix --> ignored in series recipes
This commit is contained in:
parent
91ec39e141
commit
d3fdeeacce
@ -1536,7 +1536,13 @@ function _replace_linewidth(d::KW)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function _add_defaults!(d::KW, plt::Plot, sp::Subplot, commandIndex::Int)
|
function _slice_kw!(d::KW, commandIndex::Int)
|
||||||
|
for (k,v) in d
|
||||||
|
slice_arg!(d, d, k, v, commandIndex, false)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function _add_defaults!(d::KW, commandIndex::Int)
|
||||||
# add default values to our dictionary, being careful not to delete what we just added!
|
# add default values to our dictionary, being careful not to delete what we just added!
|
||||||
for (k,v) in _series_defaults
|
for (k,v) in _series_defaults
|
||||||
slice_arg!(d, d, k, v, commandIndex, false)
|
slice_arg!(d, d, k, v, commandIndex, false)
|
||||||
|
|||||||
@ -385,9 +385,9 @@ end
|
|||||||
|
|
||||||
# this method recursively applies series recipes when the seriestype is not supported
|
# this method recursively applies series recipes when the seriestype is not supported
|
||||||
# natively by the backend
|
# natively by the backend
|
||||||
function _process_seriesrecipe(plt::Plot, d::KW)
|
function _process_seriesrecipe(d::KW)
|
||||||
# replace seriestype aliases
|
# replace seriestype aliases
|
||||||
st = Symbol(d[:seriestype])
|
st = Symbol(get(d, :seriestype, _series_defaults[:seriestype]))
|
||||||
st = d[:seriestype] = get(_typeAliases, st, st)
|
st = d[:seriestype] = get(_typeAliases, st, st)
|
||||||
|
|
||||||
# shapes shouldn't have fillrange set
|
# shapes shouldn't have fillrange set
|
||||||
@ -395,14 +395,8 @@ function _process_seriesrecipe(plt::Plot, d::KW)
|
|||||||
d[:fillrange] = nothing
|
d[:fillrange] = nothing
|
||||||
end
|
end
|
||||||
|
|
||||||
# if it's natively supported, finalize processing and pass along to the backend, otherwise recurse
|
|
||||||
if is_seriestype_supported(st)
|
if is_seriestype_supported(st)
|
||||||
sp = _prepare_subplot(plt, d)
|
return nothing
|
||||||
_prepare_annotations(sp, d)
|
|
||||||
_expand_subplot_extrema(sp, d, st)
|
|
||||||
_update_series_attributes!(d, plt, sp)
|
|
||||||
_add_the_series(plt, sp, d)
|
|
||||||
|
|
||||||
else
|
else
|
||||||
# get a sub list of series for this seriestype
|
# get a sub list of series for this seriestype
|
||||||
datalist = RecipesBase.apply_recipe(d, Val{st}, d[:x], d[:y], d[:z])
|
datalist = RecipesBase.apply_recipe(d, Val{st}, d[:x], d[:y], d[:z])
|
||||||
@ -414,7 +408,7 @@ function _process_seriesrecipe(plt::Plot, d::KW)
|
|||||||
if data.d[:seriestype] == st
|
if data.d[:seriestype] == st
|
||||||
error("The seriestype didn't change in series recipe $st. This will cause a StackOverflow.")
|
error("The seriestype didn't change in series recipe $st. This will cause a StackOverflow.")
|
||||||
end
|
end
|
||||||
_process_seriesrecipe(plt, data.d)
|
_process_seriesrecipe(data.d)
|
||||||
else
|
else
|
||||||
@warn("Unhandled recipe: $(data)")
|
@warn("Unhandled recipe: $(data)")
|
||||||
break
|
break
|
||||||
|
|||||||
21
src/plot.jl
21
src/plot.jl
@ -119,7 +119,7 @@ function plot(plt1::Plot, plts_tail::Plot...; kw...)
|
|||||||
sp.attr[:subplot_index] = idx
|
sp.attr[:subplot_index] = idx
|
||||||
for series in serieslist
|
for series in serieslist
|
||||||
merge!(series.d, series_attr)
|
merge!(series.d, series_attr)
|
||||||
_add_defaults!(series.d, plt, sp, cmdidx)
|
_add_defaults!(series.d, cmdidx)
|
||||||
push!(plt.series_list, series)
|
push!(plt.series_list, series)
|
||||||
_series_added(plt, series)
|
_series_added(plt, series)
|
||||||
cmdidx += 1
|
cmdidx += 1
|
||||||
@ -216,14 +216,13 @@ function _plot!(plt::Plot, d::KW, args::Tuple)
|
|||||||
# map(DD, kw_list)
|
# map(DD, kw_list)
|
||||||
|
|
||||||
for kw in kw_list
|
for kw in kw_list
|
||||||
sp::Subplot = kw[:subplot]
|
|
||||||
# idx = get_subplot_index(plt, sp)
|
# idx = get_subplot_index(plt, sp)
|
||||||
|
|
||||||
# # we update subplot args in case something like the color palatte is part of the recipe
|
# # we update subplot args in case something like the color palatte is part of the recipe
|
||||||
# _update_subplot_args(plt, sp, kw, idx, true)
|
# _update_subplot_args(plt, sp, kw, idx, true)
|
||||||
|
|
||||||
# set default values, select from attribute cycles, and generally set the final attributes
|
# select from attribute cycles
|
||||||
_add_defaults!(kw, plt, sp, command_idx(kw_list,kw))
|
_slice_kw!(kw, command_idx(kw_list,kw))
|
||||||
|
|
||||||
# now we have a fully specified series, with colors chosen. we must recursively handle
|
# now we have a fully specified series, with colors chosen. we must recursively handle
|
||||||
# series recipes, which dispatch on seriestype. If a backend does not natively support a seriestype,
|
# series recipes, which dispatch on seriestype. If a backend does not natively support a seriestype,
|
||||||
@ -231,7 +230,17 @@ function _plot!(plt::Plot, d::KW, args::Tuple)
|
|||||||
# For example, a histogram is just a bar plot with binned data, a bar plot is really a filled step plot,
|
# For example, a histogram is just a bar plot with binned data, a bar plot is really a filled step plot,
|
||||||
# and a step plot is really just a path. So any backend that supports drawing a path will implicitly
|
# and a step plot is really just a path. So any backend that supports drawing a path will implicitly
|
||||||
# be able to support step, bar, and histogram plots (and any recipes that use those components).
|
# be able to support step, bar, and histogram plots (and any recipes that use those components).
|
||||||
_process_seriesrecipe(plt, kw)
|
_process_seriesrecipe(kw)
|
||||||
|
|
||||||
|
# set default values, select from attribute cycles, and generally set the final attributes
|
||||||
|
_add_defaults!(kw, command_idx(kw_list,kw))
|
||||||
|
|
||||||
|
# finalize processing
|
||||||
|
sp = _prepare_subplot(plt, kw)
|
||||||
|
_prepare_annotations(sp, kw)
|
||||||
|
_expand_subplot_extrema(sp, kw, kw[:seriestype])
|
||||||
|
_update_series_attributes!(kw, plt, sp)
|
||||||
|
_add_the_series(plt, sp, kw)
|
||||||
end
|
end
|
||||||
|
|
||||||
# --------------------------------
|
# --------------------------------
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user