diff --git a/src/backends/plotly.jl b/src/backends/plotly.jl index 3b6d2794..b7b21590 100644 --- a/src/backends/plotly.jl +++ b/src/backends/plotly.jl @@ -384,7 +384,7 @@ end plotly_legend_pos(v::Tuple{S,T}) where {S<:Real, T<:Real} = (coords=v, xanchor="left", yanchor="top") - plotly_legend_pos(theta::Real) = plotly_legend_pos((theta, :inner)) +plotly_legend_pos(theta::Real) = plotly_legend_pos((theta, :inner)) function plotly_legend_pos(v::Tuple{S,Symbol}) where S<:Real (s,c) = sincosd(v[1]) diff --git a/src/legend.jl b/src/legend.jl index 7037bc14..bb1e0a46 100644 --- a/src/legend.jl +++ b/src/legend.jl @@ -20,5 +20,7 @@ end Split continuous range `[-1,1]` into an integer `[1,2,3]` """ function legend_anchor_index(x) - return ceil(Integer,2//3*(x+1)) + x<-1//3 && return 1 + x<1//3 && return 2 + return 3 end