add border_type

This commit is contained in:
t-bltg 2021-12-30 12:16:45 +01:00
parent c232e25341
commit e15eed1c8d
2 changed files with 9 additions and 2 deletions

View File

@ -971,6 +971,7 @@ const _unicodeplots_scale = [:identity, :ln, :log2, :log10]
# Additional constants # Additional constants
const _canvas_type = Ref(:auto) const _canvas_type = Ref(:auto)
const _border_type = Ref(:auto)
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
# hdf5 # hdf5

View File

@ -40,6 +40,12 @@ function unicodeplots_rebuild(plt::Plot{UnicodePlotsBackend})
ct ct
end end
border_type = if (bt = _border_type[]) == :auto
isijulia() ? :ascii : :solid
else
bt
end
kw = ( kw = (
compact = true, compact = true,
title = texmath2unicode(sp[:title]), title = texmath2unicode(sp[:title]),
@ -47,7 +53,7 @@ function unicodeplots_rebuild(plt::Plot{UnicodePlotsBackend})
ylabel = texmath2unicode(yaxis[:guide]), ylabel = texmath2unicode(yaxis[:guide]),
xscale = xaxis[:scale], xscale = xaxis[:scale],
yscale = yaxis[:scale], yscale = yaxis[:scale],
border = isijulia() ? :ascii : :solid, border = border_type,
xlim = xlim, xlim = xlim,
ylim = ylim, ylim = ylim,
) )
@ -213,7 +219,7 @@ end
function _show(io::IO, m::MIME"text/plain", plt::Plot{UnicodePlotsBackend}, ::Type{Val{true}}) function _show(io::IO, m::MIME"text/plain", plt::Plot{UnicodePlotsBackend}, ::Type{Val{true}})
nr, nc = size(plt.layout) nr, nc = size(plt.layout)
if nr == 1 && nc == 1 # fast path if nr == 1 && nc == 1 # fast path
_show(io, m, plt, Val{false}) _show(io, m, plt, Val{false})
else else
lines_colored = Array{Union{Nothing,Vector{String}}}(undef, nr, nc) lines_colored = Array{Union{Nothing,Vector{String}}}(undef, nr, nc)