Skip to content

Commit

Permalink
Fixed a bug with custom_p values in barplot_columns
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael-Sun committed Dec 11, 2024
1 parent 123200f commit 1c1f6e0
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions CanlabCore/Visualization_functions/barplot_columns.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
% :Usage:
% ::
%
% [graphics handles, adjusted data, x-data] = barplot_columns(dat, [other optional arguments])
% [graphics handles, adjusted data, x-data, statstable, order_idx] = barplot_columns(dat, [other optional arguments])
%
% This function makes a barplot of columns of data, with standard error
% bars. Optional arguments include removing continuous covariates before plotting,
Expand Down Expand Up @@ -138,7 +138,7 @@
% barplot_columns(Y, 'nofig', 'noviolin', 'colors', {[1 .5 0] [0 .5 1]}, 'dolines')
% title('barplot\_columns.m parallel coords', 'FontSize', 16)
%
% Covariate(s): Renove regressors (covs) "group":
% Covariate(s): Remove regressors (covs) "group":
% barplot_columns(mydata, figtitle, 'colors', DAT.colors, 'dolines', 'nofig', 'names', DAT.conditions, 'covs', group, 'wh_reg', 0);
%
% Covariate(s): Leave in regressor (cov) # 1 "group" and sort points by its values:
Expand Down Expand Up @@ -428,7 +428,11 @@
end

if custom_p
P=[PValues{:}]';
if iscell(PValues)
P=[PValues{:}]';
else
P=PValues';
end
% very low P-values: do not use exactly zero, because of problems
P(find(P < 10 * eps)) = 10 * eps;
end
Expand Down

0 comments on commit 1c1f6e0

Please sign in to comment.