Better legend anchor algorithm
This commit is contained in:
parent
6724a3a2fe
commit
1d3e0a5d5d
@ -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(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
|
function plotly_legend_pos(v::Tuple{S,Symbol}) where S<:Real
|
||||||
(s,c) = sincosd(v[1])
|
(s,c) = sincosd(v[1])
|
||||||
|
|||||||
@ -20,5 +20,7 @@ end
|
|||||||
Split continuous range `[-1,1]` into an integer `[1,2,3]`
|
Split continuous range `[-1,1]` into an integer `[1,2,3]`
|
||||||
"""
|
"""
|
||||||
function legend_anchor_index(x)
|
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
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user