UnicodePlots: fix setting linecolor
This commit is contained in:
parent
ede106073f
commit
d56a03975f
@ -93,7 +93,14 @@ function rebuildUnicodePlot!(plt::Plot, width, height)
|
|||||||
end
|
end
|
||||||
|
|
||||||
# add a single series
|
# add a single series
|
||||||
function addUnicodeSeries!(o, plotattributes, addlegend::Bool, xlim, ylim)
|
function addUnicodeSeries!(
|
||||||
|
o,
|
||||||
|
plotattributes,
|
||||||
|
addlegend::Bool,
|
||||||
|
xlim,
|
||||||
|
ylim;
|
||||||
|
rev_color_names = Dict(v => k for (k, v) in Colors.color_names),
|
||||||
|
)
|
||||||
# get the function, or special handling for step/bar/hist
|
# get the function, or special handling for step/bar/hist
|
||||||
st = plotattributes[:seriestype]
|
st = plotattributes[:seriestype]
|
||||||
if st == :histogram2d
|
if st == :histogram2d
|
||||||
@ -124,9 +131,11 @@ function addUnicodeSeries!(o, plotattributes, addlegend::Bool, xlim, ylim)
|
|||||||
label = addlegend ? plotattributes[:label] : ""
|
label = addlegend ? plotattributes[:label] : ""
|
||||||
|
|
||||||
# if we happen to pass in allowed color symbols, great... otherwise let UnicodePlots decide
|
# if we happen to pass in allowed color symbols, great... otherwise let UnicodePlots decide
|
||||||
color =
|
lc = convert(ARGB32, plotattributes[:linecolor])
|
||||||
plotattributes[:linecolor] in UnicodePlots.color_cycle ?
|
sym = Symbol(
|
||||||
plotattributes[:linecolor] : :auto
|
get(rev_color_names, map(Int, (red(lc).i, green(lc).i, blue(lc).i)), nothing),
|
||||||
|
)
|
||||||
|
color = sym in UnicodePlots.color_cycle ? sym : :auto
|
||||||
|
|
||||||
# add the series
|
# add the series
|
||||||
x, y = RecipesPipeline.unzip(
|
x, y = RecipesPipeline.unzip(
|
||||||
|
|||||||
@ -7,10 +7,9 @@ ismultiversion = false
|
|||||||
@static if !should_precompile
|
@static if !should_precompile
|
||||||
# nothing
|
# nothing
|
||||||
elseif !ismultios && !ismultiversion
|
elseif !ismultios && !ismultiversion
|
||||||
@static if isfile(joinpath(
|
@static if isfile(
|
||||||
@__DIR__,
|
joinpath(@__DIR__, "../deps/SnoopCompile/precompile/precompile_Plots.jl"),
|
||||||
"../deps/SnoopCompile/precompile/precompile_Plots.jl",
|
)
|
||||||
))
|
|
||||||
include("../deps/SnoopCompile/precompile/precompile_Plots.jl")
|
include("../deps/SnoopCompile/precompile/precompile_Plots.jl")
|
||||||
_precompile_()
|
_precompile_()
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user