1 | function h=m_patch(long,lat,C,varargin); |
---|
2 | % M_PATCH Create patches on a map |
---|
3 | % M_PATCH(LONG,LAT,C) is a drop-in replacement for PATCH that uses |
---|
4 | % longitude/latitude coordinates to draw a patch on the current map. |
---|
5 | % See PATCH for more details about the way in which patch colours and |
---|
6 | % properties should be specified. |
---|
7 | % |
---|
8 | % Currently you cannot specify C to be other than a string or 1x3 RGB |
---|
9 | % vector. |
---|
10 | % |
---|
11 | % See also M_LINE, M_LL2XY |
---|
12 | |
---|
13 | % Rich Pawlowicz (rich@ocgy.ubc.ca) 3/Sep/98 |
---|
14 | % |
---|
15 | % This software is provided "as is" without warranty of any kind. But |
---|
16 | % it's mine, so you can't sell it. |
---|
17 | |
---|
18 | % 10/Mar/99 - changed order of calls ('c' not handled correctly in mu_coast otherwise) |
---|
19 | % 6/Nov/00 - eliminate returned stuff if ';' neglected (thx to D Byrne) |
---|
20 | |
---|
21 | [m,n]=size(long); |
---|
22 | |
---|
23 | if m==1 & n>1, |
---|
24 | h=mu_coast('vector',[long' lat';long(1) lat(1)],'patch',C,'tag','m_patch',varargin{:}); |
---|
25 | elseif m>1 & n==1, |
---|
26 | h=mu_coast('vector',[long lat;long(1) lat(1)],'patch',C,'tag','m_patch',varargin{:}); |
---|
27 | else |
---|
28 | h=mu_coast('vector',[reshape([long;long(1,:);NaN+ones(1,n)],(m+2)*n,1),... |
---|
29 | reshape([lat;lat(1,:);NaN+ones(1,n)],(m+2)*n,1)],'patch',C,'tag','m_patch',varargin{:}); |
---|
30 | end; |
---|
31 | |
---|
32 | if nargout==0, |
---|
33 | clear h |
---|
34 | end; |
---|