Skip to content

Commit

Permalink
new function plotVariableGivenFactor,
Browse files Browse the repository at this point in the history
  • Loading branch information
dehann committed Sep 3, 2019
1 parent 4c6d342 commit 70cd23f
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/RoMEPlotting.jl
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ export
progressExamplePlot,
plotTrckStep,
plotPose2Vels,
plotProductVsKDE
plotProductVsKDE,
plotVariableGivenFactor


include("SolverVisualization.jl")
Expand Down
31 changes: 31 additions & 0 deletions src/SolverVisualization.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1251,3 +1251,34 @@ function plotTreeUpMsgs(fg::G,
# plot and return
plotKDE(beliefs, levels=levels, c=cc, title=title, legend=lbls)
end


"""
$SIGNATURES
Plot new proposal (convolution) for factor x of variable y given all other -- i.e. y|X
Notes
- plot new result on `towards` as first color.
- Plot other variables in factor on 2nd to m colors.
"""
function plotVariableGivenFactor(dfg::G,
fct::Symbol,
towards::Symbol;
levels::Int=2,
dims=nothing ) where G <: AbstractDFG
#
pts = approxConv(dfg,fct,towards)
mani = getManifolds(dfg, towards)
res = manikde!(pts,mani)

lie = ls(dfg, fct)
setdiff!(lie, [towards])

otr = map(x->getKDE(dfg,x),lie)
lbls = string.([towards;lie])

pl = plotKDE([res;otr],dims=dims,levels=levels,legend=lbls)

return pl
end

0 comments on commit 70cd23f

Please sign in to comment.