Skip to content

Commit cba0322

Browse files
authored
Use unweighted transforms in weighted plotting (#187)
* Use unweighted transforms in weighted plotting * Update Project.toml * Update test_recipesbaseext.jl
1 parent 171465a commit cba0322

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

Project.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "ContinuumArrays"
22
uuid = "7ae1f121-cc2c-504b-ac30-9b923412ae5c"
3-
version = "0.18.3"
3+
version = "0.18.4"
44

55
[deps]
66
AbstractFFTs = "621f4979-c628-5d54-868e-fcf4e3e8185c"

src/plotting.jl

+6
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ plotvalues_size(::Tuple{InfiniteCardinal{1},Int}, g, x=plotgrid(g)) = g[x,:]
3636
plotvalues_layout(lay, g, x...) = plotvalues_size(size(g), g, x...)
3737
# plotvalues_layout(::WeightedBasisLayouts, wP, n...) = plotvalues(unweighted(wP), n...)
3838
plotvalues_layout(::ExpansionLayout{MappedBasisLayout}, g, x...) = plotvalues(demap(g))
39+
function plotvalues_layout(::ExpansionLayout{<:WeightedBasisLayout}, g, x...)
40+
f = unweighted(g)
41+
w = weight(basis(g))
42+
x = plotgrid(g)
43+
w[x] .* plotvalues(f)
44+
end
3945
# plotvalues_layout(::SubBasisLayout, P::AbstractQuasiMatrix, n) = plotvalues(parent(P), maximum(parentindices(P)[2][n]))
4046
# plotvalues_layout(::SubBasisLayout, P::AbstractQuasiMatrix) = plotvalues(parent(P), maximum(parentindices(P)[2]))
4147

test/test_recipesbaseext.jl

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ import RecipesBase
3434
rep = RecipesBase.apply_recipe(Dict{Symbol, Any}(), u)
3535
@test rep[1].args == (grid(T), u[grid(T)])
3636
wrep = RecipesBase.apply_recipe(Dict{Symbol, Any}(), v)
37-
@test wrep[1].args == (grid(wT), v[grid(wT)])
37+
@test wrep[1].args[1] == grid(wT)
38+
@test wrep[1].args[2] v[grid(wT)]
3839

3940
@test plotgrid(v) == plotgrid(u) == grid(T) == grid(wT) == plotgrid_layout(MemoryLayout(v), v) == plotgrid_layout(MemoryLayout(u), u)
4041
y = affine(0..1, x)

0 commit comments

Comments
 (0)