diff --git a/src/components.jl b/src/components.jl index f4b8f337..035d1b98 100644 --- a/src/components.jl +++ b/src/components.jl @@ -131,6 +131,7 @@ immutable PlotText str::@compat(AbstractString) font::Font end +PlotText(str) = PlotText(string(str), font()) function text(str, args...) PlotText(string(str), font(args...)) @@ -268,7 +269,7 @@ end end Base.mean(x::Real, y::Real) = 0.5*(x+y) - Base.mean{N,T<:Real}(p::FixedSizeArrays.Vec{N,T}, q::FixedSizeArrays.Vec{N,T}) = 0.5 * (p + q) + Base.mean{N,T<:Real}(ps::FixedSizeArrays.Vec{N,T}...) = sum(ps) / length(ps) points(curve::BezierCurve, n::Integer = 50) = map(curve, linspace(0,1,n)) diff --git a/src/plot.jl b/src/plot.jl index c8c41605..5a2dccbe 100644 --- a/src/plot.jl +++ b/src/plot.jl @@ -187,6 +187,7 @@ annotations(::@compat(Void)) = [] annotations{X,Y,V}(v::AVec{@compat(Tuple{X,Y,V})}) = v annotations{X,Y,V}(t::@compat(Tuple{X,Y,V})) = [t] annotations(v::AVec{PlotText}) = v +annotations(v::AVec) = map(PlotText, v) annotations(anns) = error("Expecting a tuple (or vector of tuples) for annotations: ", "(x, y, annotation)\n got: $(typeof(anns))")