3 % small script demonstrating the possibilities of the
rectgrid
6 % Bernard Haasdonk 9.5.2007
9 disp(
'initializing grid and different plot modes')
10 params.xrange = [0,1];
11 params.yrange = [0,2];
12 params.xnumintervals = [10];
13 params.ynumintervals = [15];
15 params.bnd_rect_index = [];
18 params.shrink_factor = 0.9;
19 params.plot_patch = 0;
20 params.color = [1,0,0];
21 params.axis_equal = 1;
22 params.axis_tight = 1;
23 subplot(1,2,1), plot(g1,params);
24 title('line, shrink');
26 params.plot_patch = 1;
27 params.shrink_factor = 1.0;
28 params.color = [0,1,0];
29 subplot(1,2,2), plot(g1,params);
30 title('patch, noshrink');
32 disp('press key to continue');
36 disp('elementdata and vertexdata')
39 d = sqrt(g1.CX.^2+g1.CY.^2);
41 plot_element_data(g1,d,params);
42 title('element data');
44 dv = sin(((g1.X-0.4).^2+(g1.Y-1.0).^2)*10);
46 plot_vertex_data(g1,dv,params);
49 disp('press key to continue');
54 disp('sequence of data, please move slider')
56 params.title = 'vertex data sequence';
57 params.colorbar_location = 'WestOutside';
59 dv = zeros(g1.nvertices,ndata);
61 dv(:,d) = sin(((g1.X-0.4-0.5*d/ndata).^2+(g1.Y-1.0-0.2*d/ndata).^2)*10);
63 params.plot = @plot_vertex_data;
66 disp('press key to continue');
71 disp('demonstration of grid inspect')
75 disp('press key to continue');
79 disp('display method of grid:')
function r = verbose(level, message, messageId)
This function displays messages depending on a message-id and/or a level. Aditionally you can set/res...
function p = plot_sequence(varargin)
plotting a sequence of data slices on polygonal 2d grid (constructed from params if empty) and provid...
A cartesian rectangular grid in two dimensions with axis parallel elements.