From cb556492c507b49876a14ba03a3e38f497ea805d Mon Sep 17 00:00:00 2001 From: Dan O'Shea Date: Sat, 6 Aug 2016 16:08:12 -0700 Subject: [PATCH] Tweaks --- notes/table2rst.m | 1 + plotting/figUnique.m | 4 +++- stats/getPValueStr.m | 37 +++++++++++++++++++++++++++---------- 3 files changed, 31 insertions(+), 11 deletions(-) diff --git a/notes/table2rst.m b/notes/table2rst.m index ee96562..5d1c34c 100644 --- a/notes/table2rst.m +++ b/notes/table2rst.m @@ -11,6 +11,7 @@ function table2rst(t) indent = 0; looseline = '\n'; isLoose = true; +fullChar = true; [dblFmt,snglFmt] = getFloatFormats(); s = warning('off', 'MATLAB:structOnObject'); diff --git a/plotting/figUnique.m b/plotting/figUnique.m index 4bb98cd..9524fea 100644 --- a/plotting/figUnique.m +++ b/plotting/figUnique.m @@ -51,7 +51,9 @@ if isscalar(size) size = [size size]; end -figSize(size, figh); +if p.Results.undock && strcmp(figh.WindowStyle, 'normal'); + figSize(size, figh); +end hold on; if ~blankTitle && p.Results.setTitle diff --git a/stats/getPValueStr.m b/stats/getPValueStr.m index f80eb93..db7f897 100644 --- a/stats/getPValueStr.m +++ b/stats/getPValueStr.m @@ -1,13 +1,30 @@ -function s = getPValueStr(p) - if p < 0.0001 - s = 'p < 0.0001 ****'; - elseif p < 0.001 - s = 'p < 0.001 ***'; - elseif p < 0.01 - s = 'p < 0.01 **'; - elseif p < 0.05 - s = 'p < 0.05 *'; +function s = getPValueStr(p, includeStars) + if nargin < 2 + includeStars = false; + end + if includeStars + if p < 0.0001 + s = 'p < 0.0001 ****'; + elseif p < 0.001 + s = 'p < 0.001 ***'; + elseif p < 0.01 + s = 'p < 0.01 **'; + elseif p < 0.05 + s = 'p < 0.05 *'; + else + s = sprintf('p > 0.05 [%.2f]', p); + end else - s = sprintf('p > 0.05 [%.3f]', p); + if p < 0.0001 + s = 'p < 0.0001'; + elseif p < 0.001 + s = 'p < 0.001'; + elseif p < 0.01 + s = 'p < 0.01'; + elseif p < 0.05 + s = 'p < 0.05'; + else + s = sprintf('p = %.2f', p); + end end end