| MESH toolbox 0.1 Matlab/Octave mesh utils

- Main Page
- Related Pages
- Modules
- Files

- File List
- File Members

All Files Functions Groups Pages
MultiPlotMesh.m
Go to the documentation of this file.
1 function RGBcolors=MultiPlotMesh(varargin)
2 % function RGBcolors=MultiPlotMesh(varargin)
3 % Plot List of Meshes
4 %
5 % Parameters:
6 % LoM : array of Meshes
7 % RGBcolors : set boundaries colors
8 % colormap : set colormap value to \'Jet\', \'HSV\', \'Gray\', \'colorcube\',\'Cool\',\'Spring\',\'Summer\',...
9 % Legend : set legend visible at true or false
10 % MeshLineWidth : set mesh lines width
11 % LabelLineWidth : set label box lines width
12 % FontSize : set label font size
13 % Label : set mesh label visible, true or false
14 %
15 % Example:
16 % @verbatim
17 % MultiPlotMesh(LoM,'colormap','jet','Label',true) @endverbatim
18 % \image html images/MultiPlotMesh_Ring3x3_C.png "figure : MultiPlotMesh(LoM,\'colormap\',\'jet\',\'Label\',true)"
19 %
20 % See also :
21 % #LoM_demo1
22 p = inputParser;
23 p.addRequired('LoM', @isstruct);
24 %
25 p.addParamValue('colormap', 'HSV', @isstr );
26 p.addParamValue('RGBcolors', [], @isnumeric );
27 p.addParamValue('MeshLineWidth', 0.5 , @isnumeric );
28 p.addParamValue('LabelLineWidth', 2.0 , @isnumeric );
29 p.addParamValue('FontSize', 12 , @isnumeric );
30 p.addParamValue('Label', false , @islogical );
31 p.parse(varargin{:});
32 LoM=p.Results.LoM;
33
34 nM=length(LoM);
35 NumBound=unique(cat(2,LoM(:).bel));
36 nNB=length(NumBound);
37
38 cmap=colormap(p.Results.colormap);% colorcube ou Lines Jet HSV
39
40 t=0:1/(nM-1):1;t=t*0.8;
41 if (isempty(p.Results.RGBcolors))
42 RGBcolors=RGB(t(randperm(nM)),cmap);
43 else
44 RGBcolors=p.Results.RGBcolors;
45 end
46
47
48 IH=ishold;
49 if (~IH)
50 hold on
51 end
52 for i=1:nM % Boucle sur les maillages
53 h=triplot(LoM(i).me',LoM(i).q(1,:),LoM(i).q(2,:),'LineWidth',p.Results.MeshLineWidth);%,'color',RGB(t(i),cmap));
54 set(h,'color',RGBcolors(i,:));
55 end
56 if p.Results.Label
57 for i=1:nM % Boucle sur les maillages
58 I=find(LoM(i).ql == 0);
59 ip=round(length(I)/2);
60 h=text(LoM(i).q(1,I(ip)),LoM(i).q(2,I(ip)),['\Omega_{',num2str(i-1),'}']);
61 set(h,'FontSize',p.Results.FontSize,'Color','k','BackgroundColor','w', 'LineWidth',p.Results.LabelLineWidth,...
62 'EdgeColor',RGBcolors(i,:),'FontWeight','bold');
63 end
64 end
65
66 if (~IH)
67 hold off
68 end
69 axis equal
70 axis off