Merge pull request #2204 from BeastyBlacksmith/bbs/adapted_grid-change
Update adapted_grid recipes
This commit is contained in:
commit
a55f8d0099
@ -515,20 +515,24 @@ end
|
|||||||
# # special handling... xmin/xmax with parametric function(s)
|
# # special handling... xmin/xmax with parametric function(s)
|
||||||
@recipe function f(f::Function, xmin::Number, xmax::Number)
|
@recipe function f(f::Function, xmin::Number, xmax::Number)
|
||||||
xscale, yscale = [get(plotattributes, sym, :identity) for sym=(:xscale,:yscale)]
|
xscale, yscale = [get(plotattributes, sym, :identity) for sym=(:xscale,:yscale)]
|
||||||
xs = _scaled_adapted_grid(f, xscale, yscale, xmin, xmax)
|
_scaled_adapted_grid(f, xscale, yscale, xmin, xmax)
|
||||||
xs, f
|
|
||||||
end
|
end
|
||||||
@recipe function f(fs::AbstractArray{F}, xmin::Number, xmax::Number) where F<:Function
|
@recipe function f(fs::AbstractArray{F}, xmin::Number, xmax::Number) where F<:Function
|
||||||
xscale, yscale = [get(plotattributes, sym, :identity) for sym=(:xscale,:yscale)]
|
xscale, yscale = [get(plotattributes, sym, :identity) for sym=(:xscale,:yscale)]
|
||||||
xs = Any[_scaled_adapted_grid(f, xscale, yscale, xmin, xmax) for f in fs]
|
xs = ys = Array{Any}(undef, length(fs))
|
||||||
xs, fs
|
for (i, (x, y)) in enumerate(_scaled_adapted_grid(f, xscale, yscale, xmin, xmax) for f in fs)
|
||||||
|
xs[i] = x
|
||||||
|
ys[i] = y
|
||||||
|
end
|
||||||
|
xs, ys
|
||||||
end
|
end
|
||||||
@recipe f(fx::FuncOrFuncs{F}, fy::FuncOrFuncs{G}, u::AVec) where {F<:Function,G<:Function} = mapFuncOrFuncs(fx, u), mapFuncOrFuncs(fy, u)
|
@recipe f(fx::FuncOrFuncs{F}, fy::FuncOrFuncs{G}, u::AVec) where {F<:Function,G<:Function} = mapFuncOrFuncs(fx, u), mapFuncOrFuncs(fy, u)
|
||||||
@recipe f(fx::FuncOrFuncs{F}, fy::FuncOrFuncs{G}, umin::Number, umax::Number, n = 200) where {F<:Function,G<:Function} = fx, fy, range(umin, stop = umax, length = n)
|
@recipe f(fx::FuncOrFuncs{F}, fy::FuncOrFuncs{G}, umin::Number, umax::Number, n = 200) where {F<:Function,G<:Function} = fx, fy, range(umin, stop = umax, length = n)
|
||||||
|
|
||||||
function _scaled_adapted_grid(f, xscale, yscale, xmin, xmax)
|
function _scaled_adapted_grid(f, xscale, yscale, xmin, xmax)
|
||||||
(xf, xinv), (yf, yinv) = ((scalefunc(s),invscalefunc(s)) for s in (xscale,yscale))
|
(xf, xinv), (yf, yinv) = ((scalefunc(s),invscalefunc(s)) for s in (xscale,yscale))
|
||||||
xinv.(adapted_grid(yf∘f∘xinv, xf.((xmin, xmax))))
|
xs, ys = adapted_grid(yf∘f∘xinv, xf.((xmin, xmax)))
|
||||||
|
xinv.(xs), yinv.(ys)
|
||||||
end
|
end
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|||||||
@ -93,6 +93,7 @@ end
|
|||||||
for plt in plots
|
for plt in plots
|
||||||
display(plt)
|
display(plt)
|
||||||
end
|
end
|
||||||
|
@test_nowarn plot(x->x^2,0,2)
|
||||||
end
|
end
|
||||||
|
|
||||||
@testset "EmptyAnim" begin
|
@testset "EmptyAnim" begin
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user