rbmatlab 0.10.01
|
00001 function p = plot_grid(grid,params) 00002 %function p = plot_grid(grid,params) 00003 % plot method for a cubegrid. A line plot is performed. 00004 % Text can be plotted in the leafs of the grid. 00005 % 00006 % p is the list of handles to the graphics primitives 00007 % 00008 % optional params: 00009 % color : RGB vector 00010 % shrink_factor: if this flag is given, the elements are plotted shrinked 00011 % plot_level: if this flag is nonzero, a level plot is performed 00012 % level : this integer must be specified in case of level-plot 00013 % plot_patch : if this flag is set (only 2D and 3D) the plot is done 00014 % by colored patches 00015 % axis_equal : if this flag is set, set axis to equal scale 00016 % 00017 % leaftext : vector of strings. Length must be equal to number of 00018 % leafelements. The text is shown in the cogs (center of 00019 % gravities) of the leafelements. 00020 % 00021 % Markus Dihlmann 18.02.2010 00022 00023 p=plot(grid,params); 00024 00025 cogs = get(grid,'leafcogs'); 00026 00027 if isfield(params,'text') 00028 if(length(params.text)==get(grid,'nleafelements')) 00029 for i=1:length(cogs(:,1)) 00030 text(cogs(i,1)-0.025,cogs(i,2),params.text{i},'HorizontalAlignment','left','FontSize',14,'FontWeight','b'); 00031 end 00032 else 00033 disp('Couldnt show text in plot because text vector has not the appropriate length regarding nleaf_elemnts'); 00034 end 00035 end 00036 end