From d61bbcce56ebee882ce6c42332bf24eb83f5beec Mon Sep 17 00:00:00 2001 From: Daniel Schwabeneder Date: Thu, 17 Dec 2020 18:20:56 +0100 Subject: [PATCH 1/2] allow more types in `lims!` functions --- src/shorthands.jl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/shorthands.jl b/src/shorthands.jl index 16008dde..3e182bb6 100644 --- a/src/shorthands.jl +++ b/src/shorthands.jl @@ -420,13 +420,13 @@ xlabel!(s::AbstractString; kw...) = plot!(; xlabel = s, kw...) ylabel!(s::AbstractString; kw...) = plot!(; ylabel = s, kw...) "Set xlims for an existing plot" -xlims!(lims::Tuple{T,S}; kw...) where {T<:Real,S<:Real} = plot!(; xlims = lims, kw...) +xlims!(lims::Tuple{T,S}; kw...) where {T,S} = plot!(; xlims = lims, kw...) "Set ylims for an existing plot" -ylims!(lims::Tuple{T,S}; kw...) where {T<:Real,S<:Real} = plot!(; ylims = lims, kw...) +ylims!(lims::Tuple{T,S}; kw...) where {T,S} = plot!(; ylims = lims, kw...) "Set zlims for an existing plot" -zlims!(lims::Tuple{T,S}; kw...) where {T<:Real,S<:Real} = plot!(; zlims = lims, kw...) +zlims!(lims::Tuple{T,S}; kw...) where {T,S} = plot!(; zlims = lims, kw...) xlims!(xmin::Real, xmax::Real; kw...) = plot!(; xlims = (xmin,xmax), kw...) ylims!(ymin::Real, ymax::Real; kw...) = plot!(; ylims = (ymin,ymax), kw...) @@ -478,4 +478,4 @@ yaxis!(args...; kw...) = plot!(; yaxis = args xgrid!(args...; kw...) = plot!(; xgrid = args, kw...) ygrid!(args...; kw...) = plot!(; ygrid = args, kw...) -@specialize \ No newline at end of file +@specialize From 17f3faf67249bc28773ba90e0ac9d95b0a11339e Mon Sep 17 00:00:00 2001 From: Daniel Schwabeneder Date: Tue, 29 Dec 2020 11:36:59 +0100 Subject: [PATCH 2/2] simplify signature --- src/shorthands.jl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/shorthands.jl b/src/shorthands.jl index 3e182bb6..e1afb1a4 100644 --- a/src/shorthands.jl +++ b/src/shorthands.jl @@ -420,13 +420,13 @@ xlabel!(s::AbstractString; kw...) = plot!(; xlabel = s, kw...) ylabel!(s::AbstractString; kw...) = plot!(; ylabel = s, kw...) "Set xlims for an existing plot" -xlims!(lims::Tuple{T,S}; kw...) where {T,S} = plot!(; xlims = lims, kw...) +xlims!(lims::Tuple; kw...) = plot!(; xlims = lims, kw...) "Set ylims for an existing plot" -ylims!(lims::Tuple{T,S}; kw...) where {T,S} = plot!(; ylims = lims, kw...) +ylims!(lims::Tuple; kw...) = plot!(; ylims = lims, kw...) "Set zlims for an existing plot" -zlims!(lims::Tuple{T,S}; kw...) where {T,S} = plot!(; zlims = lims, kw...) +zlims!(lims::Tuple; kw...) = plot!(; zlims = lims, kw...) xlims!(xmin::Real, xmax::Real; kw...) = plot!(; xlims = (xmin,xmax), kw...) ylims!(ymin::Real, ymax::Real; kw...) = plot!(; ylims = (ymin,ymax), kw...)