Home > . > prt_plot_prediction_reg_bar.m

prt_plot_prediction_reg_bar

PURPOSE ^

FORMAT prt_plot_prediction_reg_bar(PRT, model, axes_handle)

SYNOPSIS ^

function prt_plot_prediction_reg_bar(PRT, model, axes_handle)

DESCRIPTION ^

 FORMAT prt_plot_prediction_reg_bar(PRT, model, axes_handle)

 This function plots the bar plot that appears on prt_ui_results
 Inputs:
       PRT             - data/design/model structure (it needs to contain
                         at least one estimated model).
       model           - the number of the model that will be ploted
       axes_handle     - (Optional) axes where the plot will be displayed

 Output:
       None
__________________________________________________________________________
 Copyright (C) 2011 Machine Learning & Neuroimaging Laboratory

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function prt_plot_prediction_reg_bar(PRT, model, axes_handle)
0002 % FORMAT prt_plot_prediction_reg_bar(PRT, model, axes_handle)
0003 %
0004 % This function plots the bar plot that appears on prt_ui_results
0005 % Inputs:
0006 %       PRT             - data/design/model structure (it needs to contain
0007 %                         at least one estimated model).
0008 %       model           - the number of the model that will be ploted
0009 %       axes_handle     - (Optional) axes where the plot will be displayed
0010 %
0011 % Output:
0012 %       None
0013 %__________________________________________________________________________
0014 % Copyright (C) 2011 Machine Learning & Neuroimaging Laboratory
0015 
0016 % Written by M. J. Rosa
0017 % $Id: prt_plot_prediction_reg_bar.m 706 2013-06-07 14:33:34Z cphillip $
0018 
0019 nfold = length(PRT.model(model).output.fold);
0020 
0021 %If no axes_handle is given, create a new window
0022 if ~exist('axes_handle', 'var')
0023     figure;
0024     axes_handle = axes;
0025 else
0026     set(axes_handle, 'XScale','linear');
0027 end
0028 
0029 cla(axes_handle, 'reset');
0030 preds1 = [];
0031 preds2 = [];
0032 for f = 1:nfold
0033     preds1 = [preds1; PRT.model(model).output.fold(f).targets];
0034     preds2 = [preds2; PRT.model(model).output.fold(f).predictions];
0035 end
0036 bar(axes_handle,[preds1 preds2]);
0037 xlabel(axes_handle,'subjects','FontWeight','bold');
0038 ylabel(axes_handle,'targets and predictions','FontWeight','bold');
0039 legend(axes_handle,{'Target', 'Predicted'});

Generated on Tue 10-Feb-2015 18:16:33 by m2html © 2005