forked from plotly/plotly_matlab
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathextractAreaLine.m
More file actions
56 lines (38 loc) · 1.38 KB
/
extractAreaLine.m
File metadata and controls
56 lines (38 loc) · 1.38 KB
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
45
46
47
48
49
50
51
52
53
54
function line = extractAreaLine(area_data)
% EXTRACTS THE LINE STYLE USED FOR MATLAB OBJECTS
% OF TYPE "LINE". THESE OBJECTS ARE USED IN LINESERIES,
% STAIRSERIES, STEMSERIES, BASELINESERIES, AND BOXPLOTS
%-------------------------------------------------------------------------%
%-INITIALIZE OUTPUT-%
line = struct();
%-------------------------------------------------------------------------%
%-AREA LINE COLOR-%
if(~strcmp(area_data.LineStyle,'none'))
% marker edge color
LineColor = area_data.EdgeColor;
if isnumeric(LineColor)
col = 255*LineColor;
linecolor = ['rgb(' num2str(col(1)) ',' num2str(col(2)) ',' num2str(col(3)) ')'];
else
linecolor = 'rgba(0,0,0,0)';
end
line.color = linecolor;
%-------------------------------------------------------------------------%
%-PATCH LINE WIDTH (STYLE)-%
line.width = area_data.LineWidth;
%-------------------------------------------------------------------------%
%-PATCH LINE DASH (STYLE)-%
switch area_data.LineStyle
case '-'
LineStyle = 'solid';
case '--'
LineStyle = 'dash';
case ':'
LineStyle = 'dot';
case '-.'
LineStyle = 'dashdot';
end
line.dash = LineStyle;
%-------------------------------------------------------------------------%
end
end