UnicodePlots: toggle canvas blend with extra_kwargs
This commit is contained in:
parent
46e19d9ad5
commit
3e8db4532b
@ -1,8 +1,5 @@
|
|||||||
# https://github.com/JuliaPlots/UnicodePlots.jl
|
# https://github.com/JuliaPlots/UnicodePlots.jl
|
||||||
|
|
||||||
# don't warn on unsupported... there's just too many warnings !
|
|
||||||
warn_on_unsupported_args(::UnicodePlotsBackend, plotattributes) = nothing
|
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------------------
|
||||||
const _canvas_map = (
|
const _canvas_map = (
|
||||||
braille = UnicodePlots.BrailleCanvas,
|
braille = UnicodePlots.BrailleCanvas,
|
||||||
@ -17,6 +14,7 @@ const _canvas_map = (
|
|||||||
# do all the magic here... build it all at once,
|
# do all the magic here... build it all at once,
|
||||||
# since we need to know about all the series at the very beginning
|
# since we need to know about all the series at the very beginning
|
||||||
function unicodeplots_rebuild(plt::Plot{UnicodePlotsBackend})
|
function unicodeplots_rebuild(plt::Plot{UnicodePlotsBackend})
|
||||||
|
plt.attr[:warn_on_unsupported] = false
|
||||||
plt.o = UnicodePlots.Plot[]
|
plt.o = UnicodePlots.Plot[]
|
||||||
|
|
||||||
has_layout = prod(size(plt.layout)) > 1
|
has_layout = prod(size(plt.layout)) > 1
|
||||||
@ -54,8 +52,10 @@ function unicodeplots_rebuild(plt::Plot{UnicodePlotsBackend})
|
|||||||
|
|
||||||
grid = xaxis[:grid] && yaxis[:grid]
|
grid = xaxis[:grid] && yaxis[:grid]
|
||||||
quiver = contour = false
|
quiver = contour = false
|
||||||
|
blend = true
|
||||||
for series in series_list(sp)
|
for series in series_list(sp)
|
||||||
st = series[:seriestype]
|
st = series[:seriestype]
|
||||||
|
blend &= get(series[:extra_kwargs], :blend, true)
|
||||||
quiver |= series[:arrow] isa Arrow # post-pipeline detection (:quiver -> :path)
|
quiver |= series[:arrow] isa Arrow # post-pipeline detection (:quiver -> :path)
|
||||||
contour |= st === :contour
|
contour |= st === :contour
|
||||||
if st === :histogram2d
|
if st === :histogram2d
|
||||||
@ -66,6 +66,7 @@ function unicodeplots_rebuild(plt::Plot{UnicodePlotsBackend})
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
grid &= !contour && !quiver
|
grid &= !contour && !quiver
|
||||||
|
blend &= !(quiver || contour)
|
||||||
|
|
||||||
kw = (
|
kw = (
|
||||||
compact = true,
|
compact = true,
|
||||||
@ -73,7 +74,7 @@ function unicodeplots_rebuild(plt::Plot{UnicodePlotsBackend})
|
|||||||
xlabel = texmath2unicode(xaxis[:guide]),
|
xlabel = texmath2unicode(xaxis[:guide]),
|
||||||
ylabel = texmath2unicode(yaxis[:guide]),
|
ylabel = texmath2unicode(yaxis[:guide]),
|
||||||
grid = grid,
|
grid = grid,
|
||||||
blend = !(quiver || contour),
|
blend = blend,
|
||||||
height = height,
|
height = height,
|
||||||
width = width,
|
width = width,
|
||||||
xscale = xaxis[:scale],
|
xscale = xaxis[:scale],
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user