comparison toolboxes/FullBNT-1.0.7/KPMtools/plotBox.m @ 0:cc4b1211e677 tip

initial commit to HG from Changeset: 646 (e263d8a21543) added further path and more save "camirversion.m"
author Daniel Wolff
date Fri, 19 Aug 2016 13:07:06 +0200
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:cc4b1211e677
1 function [h, ht] =plotBox(box, col, str)
2 % function h=plotBox(box, col, str)
3 %
4 % box = [xlow xhigh ylow yhigh]
5 % col = color (default - red)
6 % str = string printed at center (default '')
7
8 if nargin < 2, col = 'r'; end
9 if nargin < 3, str = ''; end
10
11 box = double(box); % fails on single
12
13 h = plot([box(1) box(2) box(2) box(1) box(1)], [ box(3) box(3) box(4) box(4) box(3)]);
14 set(h, 'color', col);
15 set(h, 'linewidth', 2);
16 if ~isempty(str)
17 xc = mean(box(1:2));
18 yc = mean(box(3:4));
19 ht = text(xc, yc, str);
20 else
21 ht = [];
22 end