Skip to content

Commit

Permalink
simplify - histogram is not a special case
Browse files Browse the repository at this point in the history
  • Loading branch information
bbejanov committed Dec 12, 2023
1 parent b6f3f79 commit e1773e3
Showing 1 changed file with 8 additions and 17 deletions.
25 changes: 8 additions & 17 deletions src/plotrecipes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -59,24 +59,15 @@ end
# This "user"-type recipe is for plotting multiple TSeries.
# It calls the one_tseries recipe in a loop
@recipe function many_tseries(ts::TSeries...)
# populate x with the range and y with t itself.
# divert to seriestype=:tseries (done in one_tseries() above), but
# keep track of the original seriestype, so we can restore it
_org_st = get(plotattributes, :seriestype, :path)
if _org_st == :histogram
# histogram uses only the values
for t in ts
@series begin
values(t)
end
end
else
# populate x with the range and y with t itself.
# divert to seriestype=:tseries (done in one_tseries() above), but
# keep track of the original seriestype, so we can restore it
for t = ts
@series begin
seriestype := :tseries
_org_st := _org_st
(rangeof(t), t)
end
for t = ts
@series begin
seriestype := :tseries
_org_st := _org_st
(rangeof(t), t)
end
end
end
Expand Down

0 comments on commit e1773e3

Please sign in to comment.