rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
plot_grid.m
1 function p = plot_grid(grid,params)
2 %function p = plot_grid(grid,params)
3 % plot method for a cubegrid. A line plot is performed.
4 % Text can be plotted in the leafs of the grid.
5 %
6 % p is the list of handles to the graphics primitives
7 %
8 % optional params:
9 % color : RGB vector
10 % shrink_factor: if this flag is given, the elements are plotted shrinked
11 % plot_level: if this flag is nonzero, a level plot is performed
12 % level : this integer must be specified in case of level-plot
13 % plot_patch : if this flag is set (only 2D and 3D) the plot is done
14 % by colored patches
15 % axis_equal : if this flag is set, set axis to equal scale
16 %
17 % leaftext : vector of strings. Length must be equal to number of
18 % leafelements. The text is shown in the cogs (center of
19 % gravities) of the leafelements.
20 %
21 % Markus Dihlmann 18.02.2010
22 
23 p=plot(grid,params);
24 
25 cogs = get(grid,'leafcogs');
26 
27 if isfield(params,'text')
28 if(length(params.text)==get(grid,'nleafelements'))
29  for i=1:length(cogs(:,1))
30  text(cogs(i,1)-0.025,cogs(i,2),params.text{i},'HorizontalAlignment','left','FontSize',14,'FontWeight','b');
31  end
32 else
33  disp('Couldnt show text in plot because text vector has not the appropriate length regarding nleaf_elemnts');
34 end
35 end
36 end
A hierarchical cubegrid of arbitrary dimension.
Definition: cubegrid.m:17