comparison toolboxes/MIRtoolbox1.3.2/MIRToolbox/surfplot.m @ 0:e9a9cd732c1e tip

first hg version after svn
author wolffd
date Tue, 10 Feb 2015 15:05:51 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:e9a9cd732c1e
1 function h = surfplot(varargin)
2 %SURFPLOT Pseudocolor (checkerboard) plot.
3 % SURFPLOT(C) is a pseudocolor or "checkerboard" plot of matrix C.
4 % The values of the elements of C specify the color in each
5 % cell of the plot. In the default shading mode, 'faceted',
6 % each cell has a constant color and the last row and column of
7 % C are not used. With shading('interp'), each cell has color
8 % resulting from bilinear interpolation of the color at its
9 % four vertices and all elements of C are used.
10 % The smallest and largest elements of C are assigned the first and
11 % last colors given in the color table; colors for the remainder of the
12 % elements in C are determined by table-lookup within the remainder of
13 % the color table.
14 %
15 % SURFPLOT(X,Y,C), where X and Y are vectors or matrices, makes a
16 % pseudocolor plot on the grid defined by X and Y. X and Y could
17 % define the grid for a "disk", for example.
18 %
19 % SURFPLOT(AX,..) plots into AX instead of GCA.
20 %
21 % H = SURFPLOT(...) returns a handle to a SURFACE object.
22 %
23 % SURFPLOT is really a SURF with its view set to directly above.
24
25 % SURFPLOT is equivalent to PCOLOR, but slighted corrected for MIRToolbox
26
27 %-------------------------------
28 % Additional details:
29 %
30 %
31 % PCOLOR sets the View property of the SURFACE object to directly
32 % overhead.
33 %
34 % If the NextPlot axis property is REPLACE (HOLD is off), PCOLOR resets
35 % all axis properties, except Position, to their default values
36 % and deletes all axis children (line, patch, surf, image, and
37 % text objects). View is set to [0 90].
38
39 % Copyright 1984-2002 The MathWorks, Inc.
40 % $Revision: 5.9.4.1 $ $Date: 2002/10/24 02:14:11 $
41
42 % Slightly corrected for MIRToolbox
43
44 % J.N. Little 1-5-92
45
46 % Parse possible Axes input
47 [cax,args,nargs] = axescheck(varargin{:});
48 error(nargchk(1,4,nargs))
49
50 cax = newplot(cax);
51 hold_state = ishold(cax);
52
53 if nargs == 1
54 x = args{1};
55 hh = surface(zeros(size(x)),x,'parent',cax);
56 [m,n] = size(x);
57 lims = [ 1 n 1 m];
58 elseif nargs == 3
59 [x,y,c] = deal(args{1:3});
60 %cc = zeros(size(y,1),size(x,2));
61 %cc(1:size(c,1),1:size(c,2)) = c;
62 hh = surface(x,y,zeros(size(y,1),size(x,2)),c,'parent',cax,'EdgeColor','none'); % Here are the modification
63 lims = [min(min(x)) max(max(x)) min(min(y)) max(max(y))];
64 else
65 error('Must have one or three input data arguments.')
66 end
67 if ~hold_state
68 set(cax,'View',[0 90]);
69 set(cax,'Box','on');
70 axis(cax,lims);
71 end
72 if nargout == 1
73 h = hh;
74 end