Merge branch 'master' into patch-2
This commit is contained in:
commit
ce02feef5a
2
.github/workflows/format_pr.yml
vendored
2
.github/workflows/format_pr.yml
vendored
@ -12,7 +12,7 @@ jobs:
|
|||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Install JuliaFormatter and format
|
- name: Install JuliaFormatter and format
|
||||||
run: |
|
run: |
|
||||||
julia -e 'import Pkg; pkg"add JuliaFormatter CSTParser#master"'
|
julia -e 'using Pkg; pkg"add JuliaFormatter CSTParser#master"'
|
||||||
julia -e 'using JuliaFormatter; [format(["src", "test"]) for _ in 1:2]'
|
julia -e 'using JuliaFormatter; [format(["src", "test"]) for _ in 1:2]'
|
||||||
git diff --exit-code
|
git diff --exit-code
|
||||||
|
|
||||||
|
|||||||
@ -31,6 +31,7 @@ SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
|
|||||||
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
|
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
|
||||||
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
|
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
|
||||||
UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
|
UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
|
||||||
|
Downloads = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
|
||||||
|
|
||||||
[compat]
|
[compat]
|
||||||
Contour = "0.5"
|
Contour = "0.5"
|
||||||
|
|||||||
@ -31,6 +31,7 @@ using Base.Meta
|
|||||||
@reexport using PlotThemes
|
@reexport using PlotThemes
|
||||||
import Showoff
|
import Showoff
|
||||||
import StatsBase
|
import StatsBase
|
||||||
|
import Downloads
|
||||||
import JSON
|
import JSON
|
||||||
|
|
||||||
using Requires
|
using Requires
|
||||||
|
|||||||
@ -14,6 +14,7 @@ const _arg_desc = KW(
|
|||||||
:fillcolor => "Color Type. Color of the filled area of path or bar types. `:match` will take the value from `:seriescolor`.",
|
:fillcolor => "Color Type. Color of the filled area of path or bar types. `:match` will take the value from `:seriescolor`.",
|
||||||
:fillalpha => "Number in [0,1]. The alpha/opacity override for the fill area. `nothing` (the default) means it will take the alpha value of fillcolor.",
|
:fillalpha => "Number in [0,1]. The alpha/opacity override for the fill area. `nothing` (the default) means it will take the alpha value of fillcolor.",
|
||||||
:markershape => "Symbol, Shape, or AbstractVector. Choose from $(_allMarkers).",
|
:markershape => "Symbol, Shape, or AbstractVector. Choose from $(_allMarkers).",
|
||||||
|
:fillstyle => "Symbol. Style of the fill area. `nothing` (the default) means solid fill. Choose from :/, :\\, :|, :-, :+, :x",
|
||||||
:markercolor => "Color Type. Color of the interior of the marker or shape. `:match` will take the value from `:seriescolor`.",
|
:markercolor => "Color Type. Color of the interior of the marker or shape. `:match` will take the value from `:seriescolor`.",
|
||||||
:markeralpha => "Number in [0,1]. The alpha/opacity override for the marker interior. `nothing` (the default) means it will take the alpha value of markercolor.",
|
:markeralpha => "Number in [0,1]. The alpha/opacity override for the marker interior. `nothing` (the default) means it will take the alpha value of markercolor.",
|
||||||
:markersize => "Number or AbstractVector. Size (radius pixels) of the markers",
|
:markersize => "Number or AbstractVector. Size (radius pixels) of the markers",
|
||||||
|
|||||||
@ -348,6 +348,7 @@ const _series_defaults = KW(
|
|||||||
:fillrange => nothing, # ribbons, areas, etc
|
:fillrange => nothing, # ribbons, areas, etc
|
||||||
:fillcolor => :match,
|
:fillcolor => :match,
|
||||||
:fillalpha => nothing,
|
:fillalpha => nothing,
|
||||||
|
:fillstyle => nothing,
|
||||||
:markershape => :none,
|
:markershape => :none,
|
||||||
:markercolor => :match,
|
:markercolor => :match,
|
||||||
:markeralpha => nothing,
|
:markeralpha => nothing,
|
||||||
@ -1117,6 +1118,7 @@ function processLineArg(plotattributes::AKW, arg)
|
|||||||
arg.color == :auto ? :auto : plot_color(arg.color)
|
arg.color == :auto ? :auto : plot_color(arg.color)
|
||||||
)
|
)
|
||||||
arg.alpha === nothing || (plotattributes[:fillalpha] = arg.alpha)
|
arg.alpha === nothing || (plotattributes[:fillalpha] = arg.alpha)
|
||||||
|
arg.style === nothing || (plotattributes[:fillstyle] = arg.style)
|
||||||
|
|
||||||
elseif typeof(arg) <: Arrow || arg in (:arrow, :arrows)
|
elseif typeof(arg) <: Arrow || arg in (:arrow, :arrows)
|
||||||
plotattributes[:arrow] = arg
|
plotattributes[:arrow] = arg
|
||||||
@ -1188,6 +1190,7 @@ function processFillArg(plotattributes::AKW, arg)
|
|||||||
arg.color == :auto ? :auto : plot_color(arg.color)
|
arg.color == :auto ? :auto : plot_color(arg.color)
|
||||||
)
|
)
|
||||||
arg.alpha === nothing || (plotattributes[:fillalpha] = arg.alpha)
|
arg.alpha === nothing || (plotattributes[:fillalpha] = arg.alpha)
|
||||||
|
arg.style === nothing || (plotattributes[:fillstyle] = arg.style)
|
||||||
|
|
||||||
elseif typeof(arg) <: Bool
|
elseif typeof(arg) <: Bool
|
||||||
plotattributes[:fillrange] = arg ? 0 : nothing
|
plotattributes[:fillrange] = arg ? 0 : nothing
|
||||||
|
|||||||
@ -225,13 +225,13 @@ function gaston_add_series(plt::Plot{GastonBackend}, series::Series)
|
|||||||
gsp = sp.o
|
gsp = sp.o
|
||||||
x, y, z = series[:x], series[:y], series[:z]
|
x, y, z = series[:x], series[:y], series[:z]
|
||||||
st = series[:seriestype]
|
st = series[:seriestype]
|
||||||
|
|
||||||
curves = []
|
curves = []
|
||||||
if gsp.dims == 2 && z === nothing
|
if gsp.dims == 2 && z === nothing
|
||||||
for (n, seg) in enumerate(series_segments(series, st; check = true))
|
for (n, seg) in enumerate(series_segments(series, st; check = true))
|
||||||
i, rng = seg.attr_index, seg.range
|
i, rng = seg.attr_index, seg.range
|
||||||
|
fr =_cycle(series[:fillrange], 1:length(x[rng]))
|
||||||
for sc in gaston_seriesconf!(sp, series, i, n == 1)
|
for sc in gaston_seriesconf!(sp, series, i, n == 1)
|
||||||
push!(curves, Gaston.Curve(x[rng], y[rng], nothing, nothing, sc))
|
push!(curves, Gaston.Curve(x[rng], y[rng], nothing, fr, sc))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@ -304,8 +304,12 @@ function gaston_seriesconf!(
|
|||||||
pt, ps, mc = gaston_mk_ms_mc(series, clims, i)
|
pt, ps, mc = gaston_mk_ms_mc(series, clims, i)
|
||||||
push!(curveconf, "w points pt $pt ps $ps lc $mc")
|
push!(curveconf, "w points pt $pt ps $ps lc $mc")
|
||||||
elseif st ∈ (:path, :straightline, :path3d)
|
elseif st ∈ (:path, :straightline, :path3d)
|
||||||
|
fr = series[:fillrange]
|
||||||
|
fc = gaston_color(get_fillcolor(series, i), get_fillalpha(series, i))
|
||||||
lc, dt, lw = gaston_lc_ls_lw(series, clims, i)
|
lc, dt, lw = gaston_lc_ls_lw(series, clims, i)
|
||||||
if series[:markershape] == :none # simplepath
|
if fr !== nothing # filled curves, but not filled curves with markers
|
||||||
|
push!(curveconf, "w filledcurves fc $fc fs solid border lc $lc lw $lw dt $dt,'' w lines lc $lc lw $lw dt $dt")
|
||||||
|
elseif series[:markershape] == :none # simplepath
|
||||||
push!(curveconf, "w lines lc $lc dt $dt lw $lw")
|
push!(curveconf, "w lines lc $lc dt $dt lw $lw")
|
||||||
else
|
else
|
||||||
pt, ps, mc = gaston_mk_ms_mc(series, clims, i)
|
pt, ps, mc = gaston_mk_ms_mc(series, clims, i)
|
||||||
|
|||||||
@ -136,6 +136,23 @@ gr_set_arrowstyle(s::Symbol) = GR.setarrowstyle(
|
|||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
gr_set_fillstyle(::Nothing) = GR.setfillintstyle(GR.INTSTYLE_SOLID)
|
||||||
|
function gr_set_fillstyle(s::Symbol)
|
||||||
|
GR.setfillintstyle(GR.INTSTYLE_HATCH)
|
||||||
|
GR.setfillstyle(get(
|
||||||
|
(
|
||||||
|
(/) = 9,
|
||||||
|
(\) = 10,
|
||||||
|
(|) = 7,
|
||||||
|
(-) = 8,
|
||||||
|
(+) = 11,
|
||||||
|
(x) = 6,
|
||||||
|
),
|
||||||
|
s,
|
||||||
|
9),
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
# --------------------------------------------------------------------------------------
|
# --------------------------------------------------------------------------------------
|
||||||
|
|
||||||
# draw line segments, splitting x/y into contiguous/finite segments
|
# draw line segments, splitting x/y into contiguous/finite segments
|
||||||
@ -1058,7 +1075,9 @@ function gr_add_legend(sp, leg, viewport_plotarea)
|
|||||||
series[:ribbon] === nothing
|
series[:ribbon] === nothing
|
||||||
)
|
)
|
||||||
fc = get_fillcolor(series, clims)
|
fc = get_fillcolor(series, clims)
|
||||||
gr_set_fill(fc) #, series[:fillalpha])
|
gr_set_fill(fc)
|
||||||
|
fs = get_fillstyle(series, i)
|
||||||
|
gr_set_fillstyle(fs)
|
||||||
l, r = xpos - leg.width_factor * 3.5, xpos - leg.width_factor / 2
|
l, r = xpos - leg.width_factor * 3.5, xpos - leg.width_factor / 2
|
||||||
b, t = ypos - 0.4 * leg.dy, ypos + 0.4 * leg.dy
|
b, t = ypos - 0.4 * leg.dy, ypos + 0.4 * leg.dy
|
||||||
x = [l, r, r, l, l]
|
x = [l, r, r, l, l]
|
||||||
@ -1824,6 +1843,8 @@ function gr_draw_segments(series, x, y, fillrange, clims)
|
|||||||
i, rng = segment.attr_index, segment.range
|
i, rng = segment.attr_index, segment.range
|
||||||
fc = get_fillcolor(series, clims, i)
|
fc = get_fillcolor(series, clims, i)
|
||||||
gr_set_fillcolor(fc)
|
gr_set_fillcolor(fc)
|
||||||
|
fs = get_fillstyle(series, i)
|
||||||
|
gr_set_fillstyle(fs)
|
||||||
fx = _cycle(x, vcat(rng, reverse(rng)))
|
fx = _cycle(x, vcat(rng, reverse(rng)))
|
||||||
fy = vcat(_cycle(fr_from, rng), _cycle(fr_to, reverse(rng)))
|
fy = vcat(_cycle(fr_from, rng), _cycle(fr_to, reverse(rng)))
|
||||||
gr_set_transparency(fc, get_fillalpha(series, i))
|
gr_set_transparency(fc, get_fillalpha(series, i))
|
||||||
@ -1912,6 +1933,8 @@ function gr_draw_shapes(series, clims)
|
|||||||
# draw the interior
|
# draw the interior
|
||||||
fc = get_fillcolor(series, clims, i)
|
fc = get_fillcolor(series, clims, i)
|
||||||
gr_set_fill(fc)
|
gr_set_fill(fc)
|
||||||
|
fs = get_fillstyle(series, i)
|
||||||
|
gr_set_fillstyle(fs)
|
||||||
gr_set_transparency(fc, get_fillalpha(series, i))
|
gr_set_transparency(fc, get_fillalpha(series, i))
|
||||||
GR.fillarea(xseg, yseg)
|
GR.fillarea(xseg, yseg)
|
||||||
|
|
||||||
|
|||||||
@ -162,6 +162,9 @@ function py_fillstepstyle(seriestype::Symbol)
|
|||||||
return nothing
|
return nothing
|
||||||
end
|
end
|
||||||
|
|
||||||
|
py_fillstyle(::Nothing) = nothing
|
||||||
|
py_fillstyle(fillstyle::Symbol) = string(fillstyle)
|
||||||
|
|
||||||
# # untested... return a FontProperties object from a Plots.Font
|
# # untested... return a FontProperties object from a Plots.Font
|
||||||
# function py_font(font::Font)
|
# function py_font(font::Font)
|
||||||
# pyfont["FontProperties"](
|
# pyfont["FontProperties"](
|
||||||
@ -709,24 +712,45 @@ function py_add_series(plt::Plot{PyPlotBackend}, series::Series)
|
|||||||
for segment in series_segments(series)
|
for segment in series_segments(series)
|
||||||
i, rng = segment.attr_index, segment.range
|
i, rng = segment.attr_index, segment.range
|
||||||
if length(rng) > 1
|
if length(rng) > 1
|
||||||
|
lc = get_linecolor(series, clims, i)
|
||||||
|
la = get_linealpha(series, i)
|
||||||
|
ls = get_linestyle(series, i)
|
||||||
|
fc = get_fillcolor(series, clims, i)
|
||||||
|
fa = get_fillalpha(series, i)
|
||||||
|
fs = get_fillstyle(series, i)
|
||||||
|
has_fs = !isnothing(fs)
|
||||||
|
|
||||||
path = pypath."Path"(hcat(x[rng], y[rng]))
|
path = pypath."Path"(hcat(x[rng], y[rng]))
|
||||||
|
|
||||||
|
# shape outline (and potentially solid fill)
|
||||||
patches = pypatches."PathPatch"(
|
patches = pypatches."PathPatch"(
|
||||||
path;
|
path;
|
||||||
label = series[:label],
|
label = series[:label],
|
||||||
zorder = series[:series_plotindex],
|
zorder = series[:series_plotindex],
|
||||||
edgecolor = py_color(
|
edgecolor = py_color(lc, la),
|
||||||
get_linecolor(series, clims, i),
|
facecolor = py_color(fc, has_fs ? 0 : fa),
|
||||||
get_linealpha(series, i),
|
|
||||||
),
|
|
||||||
facecolor = py_color(
|
|
||||||
get_fillcolor(series, clims, i),
|
|
||||||
get_fillalpha(series, i),
|
|
||||||
),
|
|
||||||
linewidth = py_thickness_scale(plt, get_linewidth(series, i)),
|
linewidth = py_thickness_scale(plt, get_linewidth(series, i)),
|
||||||
linestyle = py_linestyle(st, get_linestyle(series, i)),
|
linestyle = py_linestyle(st, ls),
|
||||||
fill = true,
|
fill = !has_fs,
|
||||||
)
|
)
|
||||||
push!(handle, ax."add_patch"(patches))
|
push!(handle, ax."add_patch"(patches))
|
||||||
|
|
||||||
|
# shape hatched fill
|
||||||
|
# hatch color/alpha are controlled by edge (not face) color/alpha
|
||||||
|
if has_fs
|
||||||
|
patches = pypatches."PathPatch"(
|
||||||
|
path;
|
||||||
|
label = "",
|
||||||
|
zorder = series[:series_plotindex],
|
||||||
|
edgecolor = py_color(fc, fa),
|
||||||
|
facecolor = py_color(fc, 0), # don't fill with solid background
|
||||||
|
hatch = py_fillstyle(fs),
|
||||||
|
linewidth = 0, # don't replot shape outline (doesn't affect hatch linewidth)
|
||||||
|
linestyle = py_linestyle(st, ls),
|
||||||
|
fill = false,
|
||||||
|
)
|
||||||
|
push!(handle, ax."add_patch"(patches))
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
push!(handles, handle)
|
push!(handles, handle)
|
||||||
@ -754,17 +778,24 @@ function py_add_series(plt::Plot{PyPlotBackend}, series::Series)
|
|||||||
dim1, _cycle(fillrange[1], rng), _cycle(fillrange[2], rng)
|
dim1, _cycle(fillrange[1], rng), _cycle(fillrange[2], rng)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
la = get_linealpha(series, i)
|
||||||
|
fc = get_fillcolor(series, clims, i)
|
||||||
|
fa = get_fillalpha(series, i)
|
||||||
|
fs = get_fillstyle(series, i)
|
||||||
|
has_fs = !isnothing(fs)
|
||||||
|
|
||||||
handle = getproperty(ax, f)(
|
handle = getproperty(ax, f)(
|
||||||
args...,
|
args...,
|
||||||
trues(n),
|
trues(n),
|
||||||
false,
|
false,
|
||||||
py_fillstepstyle(st);
|
py_fillstepstyle(st);
|
||||||
zorder = series[:series_plotindex],
|
zorder = series[:series_plotindex],
|
||||||
facecolor = py_color(
|
# hatch color/alpha are controlled by edge (not face) color/alpha
|
||||||
get_fillcolor(series, clims, i),
|
# if has_fs, set edge color/alpha <- fill color/alpha and face alpha <- 0
|
||||||
get_fillalpha(series, i),
|
edgecolor = py_color(fc, has_fs ? fa : la),
|
||||||
),
|
facecolor = py_color(fc, has_fs ? 0 : fa),
|
||||||
linewidths = 0,
|
hatch = py_fillstyle(fs),
|
||||||
|
linewidths = 0
|
||||||
)
|
)
|
||||||
push!(handles, handle)
|
push!(handles, handle)
|
||||||
end
|
end
|
||||||
@ -1455,67 +1486,82 @@ function py_add_legend(plt::Plot, sp::Subplot, ax)
|
|||||||
if should_add_to_legend(series)
|
if should_add_to_legend(series)
|
||||||
clims = get_clims(sp, series)
|
clims = get_clims(sp, series)
|
||||||
# add a line/marker and a label
|
# add a line/marker and a label
|
||||||
push!(
|
if series[:seriestype] == :shape || series[:fillrange] !== nothing
|
||||||
handles,
|
lc = get_linecolor(series, clims)
|
||||||
if series[:seriestype] == :shape || series[:fillrange] !== nothing
|
la = get_linealpha(series)
|
||||||
pypatches."Patch"(
|
ls = get_linestyle(series)
|
||||||
edgecolor = py_color(
|
fc = get_fillcolor(series, clims)
|
||||||
single_color(get_linecolor(series, clims)),
|
fa = get_fillalpha(series)
|
||||||
get_linealpha(series),
|
fs = get_fillstyle(series)
|
||||||
),
|
has_fs = !isnothing(fs)
|
||||||
facecolor = py_color(
|
|
||||||
single_color(get_fillcolor(series, clims)),
|
# line (and potentially solid fill)
|
||||||
get_fillalpha(series),
|
line_handle = pypatches."Patch"(
|
||||||
),
|
edgecolor = py_color(single_color(lc), la),
|
||||||
linewidth = py_thickness_scale(
|
facecolor = py_color(single_color(fc), has_fs ? 0 : fa),
|
||||||
plt,
|
linewidth = py_thickness_scale(plt, clamp(get_linewidth(series), 0, 5)),
|
||||||
clamp(get_linewidth(series), 0, 5),
|
linestyle = py_linestyle(series[:seriestype], ls),
|
||||||
),
|
capstyle = "butt",
|
||||||
linestyle = py_linestyle(
|
)
|
||||||
series[:seriestype],
|
|
||||||
get_linestyle(series),
|
# hatched fill
|
||||||
),
|
# hatch color/alpha are controlled by edge (not face) color/alpha
|
||||||
|
if has_fs
|
||||||
|
fill_handle = pypatches."Patch"(
|
||||||
|
edgecolor = py_color(single_color(fc), fa),
|
||||||
|
facecolor = py_color(single_color(fc), 0), # don't fill with solid background
|
||||||
|
hatch = py_fillstyle(fs),
|
||||||
|
linewidth = 0, # don't replot shape outline (doesn't affect hatch linewidth)
|
||||||
|
linestyle = py_linestyle(series[:seriestype], ls),
|
||||||
capstyle = "butt",
|
capstyle = "butt",
|
||||||
)
|
)
|
||||||
elseif series[:seriestype] in
|
|
||||||
(:path, :straightline, :scatter, :steppre, :stepmid, :steppost)
|
# plot two handles on top of each other by passing in a tuple
|
||||||
hasline = get_linewidth(series) > 0
|
# https://matplotlib.org/stable/tutorials/intermediate/legend_guide.html
|
||||||
PyPlot.plt."Line2D"(
|
push!(handles, (line_handle, fill_handle))
|
||||||
(0, 1),
|
|
||||||
(0, 0),
|
|
||||||
color = py_color(
|
|
||||||
single_color(get_linecolor(series, clims)),
|
|
||||||
get_linealpha(series),
|
|
||||||
),
|
|
||||||
linewidth = py_thickness_scale(
|
|
||||||
plt,
|
|
||||||
hasline * sp[:legendfontsize] / 8,
|
|
||||||
),
|
|
||||||
linestyle = py_linestyle(:path, get_linestyle(series)),
|
|
||||||
solid_capstyle = "butt",
|
|
||||||
solid_joinstyle = "miter",
|
|
||||||
dash_capstyle = "butt",
|
|
||||||
dash_joinstyle = "miter",
|
|
||||||
marker = py_marker(_cycle(series[:markershape], 1)),
|
|
||||||
markersize = py_thickness_scale(plt, 0.8 * sp[:legendfontsize]),
|
|
||||||
markeredgecolor = py_color(
|
|
||||||
single_color(get_markerstrokecolor(series)),
|
|
||||||
get_markerstrokealpha(series),
|
|
||||||
),
|
|
||||||
markerfacecolor = py_color(
|
|
||||||
single_color(get_markercolor(series, clims)),
|
|
||||||
get_markeralpha(series),
|
|
||||||
),
|
|
||||||
markeredgewidth = py_thickness_scale(
|
|
||||||
plt,
|
|
||||||
0.8 * get_markerstrokewidth(series) * sp[:legendfontsize] /
|
|
||||||
first(series[:markersize]),
|
|
||||||
), # retain the markersize/markerstroke ratio from the markers on the plot
|
|
||||||
)
|
|
||||||
else
|
else
|
||||||
series[:serieshandle][1]
|
# plot line handle (which includes solid fill) only
|
||||||
end,
|
push!(handles, line_handle)
|
||||||
)
|
end
|
||||||
|
elseif series[:seriestype] in
|
||||||
|
(:path, :straightline, :scatter, :steppre, :stepmid, :steppost)
|
||||||
|
hasline = get_linewidth(series) > 0
|
||||||
|
handle = PyPlot.plt."Line2D"(
|
||||||
|
(0, 1),
|
||||||
|
(0, 0),
|
||||||
|
color = py_color(
|
||||||
|
single_color(get_linecolor(series, clims)),
|
||||||
|
get_linealpha(series),
|
||||||
|
),
|
||||||
|
linewidth = py_thickness_scale(
|
||||||
|
plt,
|
||||||
|
hasline * sp[:legendfontsize] / 8,
|
||||||
|
),
|
||||||
|
linestyle = py_linestyle(:path, get_linestyle(series)),
|
||||||
|
solid_capstyle = "butt",
|
||||||
|
solid_joinstyle = "miter",
|
||||||
|
dash_capstyle = "butt",
|
||||||
|
dash_joinstyle = "miter",
|
||||||
|
marker = py_marker(_cycle(series[:markershape], 1)),
|
||||||
|
markersize = py_thickness_scale(plt, 0.8 * sp[:legendfontsize]),
|
||||||
|
markeredgecolor = py_color(
|
||||||
|
single_color(get_markerstrokecolor(series)),
|
||||||
|
get_markerstrokealpha(series),
|
||||||
|
),
|
||||||
|
markerfacecolor = py_color(
|
||||||
|
single_color(get_markercolor(series, clims)),
|
||||||
|
get_markeralpha(series),
|
||||||
|
),
|
||||||
|
markeredgewidth = py_thickness_scale(
|
||||||
|
plt,
|
||||||
|
0.8 * get_markerstrokewidth(series) * sp[:legendfontsize] /
|
||||||
|
first(series[:markersize]),
|
||||||
|
), # retain the markersize/markerstroke ratio from the markers on the plot
|
||||||
|
)
|
||||||
|
push!(handles, handle)
|
||||||
|
else
|
||||||
|
push!(handles, series[:serieshandle][1])
|
||||||
|
end
|
||||||
push!(labels, series[:label])
|
push!(labels, series[:label])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -125,7 +125,8 @@ const _examples = PlotExample[
|
|||||||
:(
|
:(
|
||||||
begin
|
begin
|
||||||
import FileIO
|
import FileIO
|
||||||
path = download(
|
import Downloads
|
||||||
|
path = Downloads.download(
|
||||||
"http://juliaplots.org/PlotReferenceImages.jl/Plots/pyplot/0.7.0/ref1.png",
|
"http://juliaplots.org/PlotReferenceImages.jl/Plots/pyplot/0.7.0/ref1.png",
|
||||||
)
|
)
|
||||||
img = FileIO.load(path)
|
img = FileIO.load(path)
|
||||||
|
|||||||
@ -98,7 +98,7 @@ function __init__()
|
|||||||
global plotly_local_file_path[] =
|
global plotly_local_file_path[] =
|
||||||
joinpath(@get_scratch!("plotly"), _plotly_min_js_filename)
|
joinpath(@get_scratch!("plotly"), _plotly_min_js_filename)
|
||||||
if !isfile(plotly_local_file_path[])
|
if !isfile(plotly_local_file_path[])
|
||||||
download(
|
Downloads.download(
|
||||||
"https://cdn.plot.ly/$(_plotly_min_js_filename)",
|
"https://cdn.plot.ly/$(_plotly_min_js_filename)",
|
||||||
plotly_local_file_path[],
|
plotly_local_file_path[],
|
||||||
)
|
)
|
||||||
|
|||||||
@ -538,6 +538,7 @@ get_gradient(cp::ColorPalette) = cgrad(cp, categorical = true)
|
|||||||
|
|
||||||
get_linewidth(series, i::Int = 1) = _cycle(series[:linewidth], i)
|
get_linewidth(series, i::Int = 1) = _cycle(series[:linewidth], i)
|
||||||
get_linestyle(series, i::Int = 1) = _cycle(series[:linestyle], i)
|
get_linestyle(series, i::Int = 1) = _cycle(series[:linestyle], i)
|
||||||
|
get_fillstyle(series, i::Int = 1) = _cycle(series[:fillstyle], i)
|
||||||
|
|
||||||
function get_markerstrokecolor(series, i::Int = 1)
|
function get_markerstrokecolor(series, i::Int = 1)
|
||||||
msc = series[:markerstrokecolor]
|
msc = series[:markerstrokecolor]
|
||||||
@ -556,6 +557,7 @@ const _segmenting_vector_attributes = (
|
|||||||
:linestyle,
|
:linestyle,
|
||||||
:fillcolor,
|
:fillcolor,
|
||||||
:fillalpha,
|
:fillalpha,
|
||||||
|
:fillstyle,
|
||||||
:markercolor,
|
:markercolor,
|
||||||
:markeralpha,
|
:markeralpha,
|
||||||
:markersize,
|
:markersize,
|
||||||
|
|||||||
@ -12,6 +12,11 @@ using LibGit2
|
|||||||
import GeometryBasics
|
import GeometryBasics
|
||||||
using Dates
|
using Dates
|
||||||
using RecipesBase
|
using RecipesBase
|
||||||
|
using JSON
|
||||||
|
|
||||||
|
@testset "Infrastructure" begin
|
||||||
|
@test_nowarn JSON.Parser.parse(String(read(joinpath(dirname(pathof(Plots)), "..", ".zenodo.json"))))
|
||||||
|
end
|
||||||
|
|
||||||
@testset "Plotly standalone" begin
|
@testset "Plotly standalone" begin
|
||||||
@test_nowarn Plots._init_ijulia_plotting()
|
@test_nowarn Plots._init_ijulia_plotting()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user