annotate toolboxes/FullBNT-1.0.7/netlab3.3/plotmat.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
rev   line source
Daniel@0 1 function plotmat(matrix, textcolour, gridcolour, fontsize)
Daniel@0 2 %PLOTMAT Display a matrix.
Daniel@0 3 %
Daniel@0 4 % Description
Daniel@0 5 % PLOTMAT(MATRIX, TEXTCOLOUR, GRIDCOLOUR, FONTSIZE) displays the matrix
Daniel@0 6 % MATRIX on the current figure. The TEXTCOLOUR and GRIDCOLOUR
Daniel@0 7 % arguments control the colours of the numbers and grid labels
Daniel@0 8 % respectively and should follow the usual Matlab specification. The
Daniel@0 9 % parameter FONTSIZE should be an integer.
Daniel@0 10 %
Daniel@0 11 % See also
Daniel@0 12 % CONFFIG, DEMMLP2
Daniel@0 13 %
Daniel@0 14
Daniel@0 15 % Copyright (c) Ian T Nabney (1996-2001)
Daniel@0 16
Daniel@0 17 [m,n]=size(matrix);
Daniel@0 18 for rowCnt=1:m,
Daniel@0 19 for colCnt=1:n,
Daniel@0 20 numberString=num2str(matrix(rowCnt,colCnt));
Daniel@0 21 text(colCnt-.5,m-rowCnt+.5,numberString, ...
Daniel@0 22 'HorizontalAlignment','center', ...
Daniel@0 23 'Color', textcolour, ...
Daniel@0 24 'FontWeight','bold', ...
Daniel@0 25 'FontSize', fontsize);
Daniel@0 26 end;
Daniel@0 27 end;
Daniel@0 28
Daniel@0 29 set(gca,'Box','on', ...
Daniel@0 30 'Visible','on', ...
Daniel@0 31 'xLim',[0 n], ...
Daniel@0 32 'xGrid','on', ...
Daniel@0 33 'xTickLabel',[], ...
Daniel@0 34 'xTick',0:n, ...
Daniel@0 35 'yGrid','on', ...
Daniel@0 36 'yLim',[0 m], ...
Daniel@0 37 'yTickLabel',[], ...
Daniel@0 38 'yTick',0:m, ...
Daniel@0 39 'DataAspectRatio',[1, 1, 1], ...
Daniel@0 40 'GridLineStyle',':', ...
Daniel@0 41 'LineWidth',3, ...
Daniel@0 42 'XColor',gridcolour, ...
Daniel@0 43 'YColor',gridcolour);
Daniel@0 44