Generalize dict recipe for any element type. Do not default to :bar seriestype.

This commit is contained in:
yha 2019-08-12 14:12:00 +03:00 committed by Daniel Schwabeneder
parent f1cbeb549c
commit 233ebda4ab

View File

@ -355,12 +355,9 @@ end
end end
end end
# Dicts with Real values are plotted as bars # Dicts: each entry is a data point (x,y)=(key,value)
@recipe function f(d::AbstractDict{T,<:Real}) where T @recipe f(d::AbstractDict) = collect(keys(d)), collect(values(d))
seriestype --> :bar
x, y = collect(keys(d)), collect(values(d))
end
# function without range... use the current range of the x-axis # function without range... use the current range of the x-axis