From b95210a5f0ffe352e2afc5766d584e6db6239a07 Mon Sep 17 00:00:00 2001 From: Frank Dellaert Date: Sat, 15 Sep 2012 03:05:22 +0000 Subject: [PATCH] Plot Bayes tree within matlab ! (dot -> png -> imread -> imshow). --- matlab/+gtsam/plotBayesTree.m | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 matlab/+gtsam/plotBayesTree.m diff --git a/matlab/+gtsam/plotBayesTree.m b/matlab/+gtsam/plotBayesTree.m new file mode 100644 index 000000000..94628e8a5 --- /dev/null +++ b/matlab/+gtsam/plotBayesTree.m @@ -0,0 +1,8 @@ +function plotBayesTree(bayesTree) +% plotBayesTree saves as dot file, renders, and shows as image +% Needs dot installed + +bayesTree.saveGraph('/tmp/bayesTree.dot') +!dot -Tpng -o /tmp/dotImage.png /tmp/bayesTree.dot +dotImage=imread('/tmp/dotImage.png'); +imshow(dotImage) \ No newline at end of file