-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathh_2d_point.m
44 lines (38 loc) · 954 Bytes
/
h_2d_point.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
%==========================================================================
% matNWM package
% Draw NWM route link figure
%
% input :
% h --- nwm grid
%
% output :
% p --- patch handle
%
% Siqi Li, SMAST
% 2023-03-20
%
% Updates:
%
%==========================================================================
function [p1, p2] = h_2d_point(h, varargin)
varargin = read_varargin(varargin, {'Color'}, {'y'});
rt = h.rt;
lon = h.lon;
lat = h.lat;
point = unique([rt.link]);
px = lon(point);
py = lat(point);
mouth = unique([rt.mouth]);
mx = lon(mouth);
my = lat(mouth);
hold on
p1 = plot(px, py, 'o', 'MarkerSize', 1.2, ...
'MarkerFaceColor', Color, ...
'MarkerEdgeColor', Color);
p2 = plot(mx, my, 'o', 'MarkerSize', 1.5, ...
'MarkerFaceColor', Color, ...
'MarkerEdgeColor', 'k');
if ~isempty(varargin)
set(p1, varargin{:})
set(p2, varargin{:})
end