From cbf284fc1ed57d29a326aec5866d5a29e0a1597c Mon Sep 17 00:00:00 2001 From: t-bltg Date: Fri, 24 Sep 2021 16:38:20 +0200 Subject: [PATCH] UnicodePlots: support markers --- src/backends.jl | 2 +- src/backends/unicodeplots.jl | 5 ++++- src/examples.jl | 2 -- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/backends.jl b/src/backends.jl index bdfdea3d86..451576e18e 100644 --- a/src/backends.jl +++ b/src/backends.jl @@ -943,7 +943,7 @@ const _unicodeplots_seriestype = [ :spy, ] const _unicodeplots_style = [:auto, :solid] -const _unicodeplots_marker = [:none, :auto, :circle] +const _unicodeplots_marker = vcat(_allMarkers, :pixel) const _unicodeplots_scale = [:identity, :ln, :log2, :log10] # Additional constants diff --git a/src/backends/unicodeplots.jl b/src/backends/unicodeplots.jl index 15ac9db402..c1608579f8 100644 --- a/src/backends/unicodeplots.jl +++ b/src/backends/unicodeplots.jl @@ -115,11 +115,14 @@ function addUnicodeSeries!( return UnicodePlots.spy(series[:z].surf; kw...) end + series_kw = (;) + # now use the ! functions to add to the plot if st in (:path, :straightline, :shape) func = UnicodePlots.lineplot! elseif st == :scatter || series[:markershape] != :none func = UnicodePlots.scatterplot! + series_kw = (; marker=series[:markershape]) else error("Series type $st not supported by UnicodePlots") end @@ -129,7 +132,7 @@ function addUnicodeSeries!( for (n, segment) in enumerate(series_segments(series, st; check = true)) i, rng = segment.attr_index, segment.range lc = get_linecolor(series, i) - up = func(up, x[rng], y[rng]; color = up_color(lc), name = n == 1 ? label : "") + up = func(up, x[rng], y[rng]; color = up_color(lc), name = n == 1 ? label : "", series_kw...) end for (xi, yi, str, fnt) in EachAnn(series[:series_annotations], x, y) diff --git a/src/examples.jl b/src/examples.jl index 62d1cd02e2..049e5172ac 100644 --- a/src/examples.jl +++ b/src/examples.jl @@ -1255,7 +1255,6 @@ _backend_skips = Dict( :unicodeplots => [ 5, # limits issue 6, # embedded images unsupported - 13, # markers unsupported 16, # nested layout unsupported 21, # custom markers unsupported 22, # contours unsupported @@ -1269,7 +1268,6 @@ _backend_skips = Dict( 43, # heatmap with DateTime 45, # error bars 47, # mesh3D unsupported - 48, # markershapes unsupported 49, # polar heatmap 50, # 3D surface unsupported 51, # embedded images unsupported