Merge pull request #2569 from daschw/pyplot

fix pyplot shape markers
This commit is contained in:
Daniel Schwabeneder 2020-04-12 17:26:30 +02:00 committed by GitHub
commit bf849d90a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -536,13 +536,16 @@ function py_add_series(plt::Plot{PyPlotBackend}, series::Series)
msc = py_markerstrokecolor(series) msc = py_markerstrokecolor(series)
lw = py_thickness_scale(plt, series[:markerstrokewidth]) lw = py_thickness_scale(plt, series[:markerstrokewidth])
for i=eachindex(y) for i=eachindex(y)
extrakw[:c] = _cycle(markercolor, i) if series[:marker_z] !== nothing
extrakw[:c] = [py_color(get_markercolor(series, i))]
end
push!(handle, ax."scatter"(_cycle(x,i), _cycle(y,i); push!(handle, ax."scatter"(_cycle(x,i), _cycle(y,i);
label = series[:label], label = series[:label],
zorder = series[:series_plotindex] + 0.5, zorder = series[:series_plotindex] + 0.5,
marker = py_marker(_cycle(shapes,i)), marker = py_marker(_cycle(shapes,i)),
s = py_thickness_scale(plt, _cycle(series[:markersize],i) .^ 2), s = py_thickness_scale(plt, _cycle(series[:markersize],i) .^ 2),
facecolors = get_markercolor(series, i),
edgecolors = msc, edgecolors = msc,
linewidths = lw, linewidths = lw,
extrakw... extrakw...
@ -1311,7 +1314,7 @@ function py_add_legend(plt::Plot, sp::Subplot, ax)
color = py_color(single_color(get_linecolor(series, clims)), get_linealpha(series)), color = py_color(single_color(get_linecolor(series, clims)), get_linealpha(series)),
linewidth = py_thickness_scale(plt, clamp(get_linewidth(series), 0, 5)), linewidth = py_thickness_scale(plt, clamp(get_linewidth(series), 0, 5)),
linestyle = py_linestyle(:path, get_linestyle(series)), linestyle = py_linestyle(:path, get_linestyle(series)),
marker = py_marker(first(series[:markershape])), marker = py_marker(_cycle(series[:markershape], 1)),
markeredgecolor = py_color(single_color(get_markerstrokecolor(series)), get_markerstrokealpha(series)), markeredgecolor = py_color(single_color(get_markerstrokecolor(series)), get_markerstrokealpha(series)),
markerfacecolor = py_color(single_color(get_markercolor(series, clims)), get_markeralpha(series)) markerfacecolor = py_color(single_color(get_markercolor(series, clims)), get_markeralpha(series))
) )