Mercurial > hg > camir-aes2014
comparison toolboxes/FullBNT-1.0.7/KPMtools/plotBox.m @ 0:e9a9cd732c1e tip
first hg version after svn
author | wolffd |
---|---|
date | Tue, 10 Feb 2015 15:05:51 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:e9a9cd732c1e |
---|---|
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 |