Merge pull request #3409 from daschw/bar

fix multiple legend in pgfplotsx bar plots
This commit is contained in:
Daniel Schwabeneder 2021-04-01 19:59:06 +02:00 committed by GitHub
commit f39ba03da5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -341,7 +341,7 @@ function pgfx_add_series!(::Val{:path}, axis, series_opt, series, series_func, o
# treat segments
segments = collect(series_segments(series, series[:seriestype]))
sf = opt[:fillrange]
for segment in segments
for (k, segment) in enumerate(segments)
i, rng = segment.attr_index, segment.range
segment_opt = PGFPlotsX.Options()
segment_opt = merge(segment_opt, pgfx_linestyle(opt, i))
@ -397,7 +397,7 @@ function pgfx_add_series!(::Val{:path}, axis, series_opt, series, series_func, o
)
end
end
if i == 1 &&
if k == 1 &&
series[:subplot][:legend] != :none && pgfx_should_add_to_legend(series)
pgfx_filllegend!(series_opt, opt)
end