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.
6 % p is the list of handles to the graphics primitives
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
15 % axis_equal :
if this flag is set, set axis to equal scale
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.
21 % Markus Dihlmann 18.02.2010
25 cogs =
get(grid,
'leafcogs');
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');
33 disp(
'Couldnt show text in plot because text vector has not the appropriate length regarding nleaf_elemnts');
A hierarchical cubegrid of arbitrary dimension.