1
- function obj = updateErrorbar(obj , errorbarIndex )
1
+ function obj = updateErrorbar(obj , plotIndex )
2
2
3
- % type: ...[DONE]
4
- % symmetric: ...[DONE]
5
- % array: ...[DONE]
6
- % value: ...[NA]
7
- % arrayminus: ...{DONE]
8
- % valueminus: ...[NA]
9
- % color: ...[DONE]
10
- % thickness: ...[DONE]
11
- % width: ...[DONE]
12
- % opacity: ---[TODO]
13
- % visible: ...[DONE]
3
+ % -------------------------------------------------------------------------%
14
4
15
- % ------------------------------------------------------------------------ -%
5
+ % -INITIALIZATION -%
16
6
17
- % -ERRORBAR STRUCTURE -%
18
- errorbar_data = get(obj .State .Plot(errorbarIndex ).Handle);
7
+ % -get data structures -%
8
+ plotData = get(obj .State .Plot(plotIndex ).Handle);
19
9
20
- % -------------------------------------------------------------------------%
10
+ % -get error data-%
11
+ yPositiveDelta = date2NumData(plotData .YPositiveDelta );
12
+ yNegativeDelta = date2NumData(plotData .YNegativeDelta );
21
13
22
- % -UPDATE LINESERIES-%
23
- updateLineseries( obj , errorbarIndex );
14
+ xPositiveDelta = date2NumData( plotData . XPositiveDelta );
15
+ xNegativeDelta = date2NumData( plotData . XNegativeDelta );
24
16
25
- % -------------------------------------------------------------------------%
17
+ % -------------------------------------------------------------------------%
26
18
27
- % -errorbar visible-%
28
- obj.data{errorbarIndex }.error_y.visible = true ;
29
- obj.data{errorbarIndex }.error_x.visible = true ;
19
+ % -set trace-%
30
20
31
- % -------------------------------------------------------------------------%
21
+ updateLineseries( obj , plotIndex );
32
22
33
- % -errorbar type -%
34
- obj.data{errorbarIndex }.error_y.type = ' data ' ;
35
- obj.data{errorbarIndex }.error_x.type = ' data ' ;
23
+ % -errorbar visible -%
24
+ obj.data{plotIndex }.error_y.visible = true ;
25
+ obj.data{plotIndex }.error_x.visible = true ;
36
26
37
- % -------------------------------------------------------------------------%
27
+ % -errorbar type-%
28
+ obj.data{plotIndex }.error_y.type = ' data' ;
29
+ obj.data{plotIndex }.error_x.type = ' data' ;
38
30
39
- % -errorbar symmetry-%
40
- obj.data{errorbarIndex }.error_y.symmetric = false ;
31
+ % -errorbar symmetry-%
32
+ obj.data{plotIndex }.error_y.symmetric = false ;
41
33
42
- % -------------------------------------------------------------------------%
43
34
44
- % -errorbar value-%
45
- obj.data{errorbarIndex }.error_y.array = errorbar_data .YPositiveDelta ;
46
- obj.data{errorbarIndex }.error_x.array = errorbar_data .XPositiveDelta ;
35
+ % -------------------------------------------------------------------------%
47
36
48
- % ------------------------------------------------------------------------ -%
37
+ % -set errorbar data -%
49
38
50
- % -errorbar valueminus-%
51
- obj.data{errorbarIndex }.error_y.arrayminus = errorbar_data .YNegativeDelta ;
52
- obj.data{errorbarIndex }.error_x.arrayminus = errorbar_data .XNegativeDelta ;
39
+ obj.data{plotIndex }.error_y.array = yPositiveDelta ;
40
+ obj.data{plotIndex }.error_x.array = xPositiveDelta ;
53
41
54
- % -------------------------------------------------------------------------%
42
+ obj.data{plotIndex }.error_x.arrayminus = xNegativeDelta ;
43
+ obj.data{plotIndex }.error_y.arrayminus = yNegativeDelta ;
55
44
56
- % -errorbar thickness-%
57
- obj.data{errorbarIndex }.error_y.thickness = errorbar_data .LineWidth ;
58
- obj.data{errorbarIndex }.error_x.thickness = errorbar_data .LineWidth ;
45
+ % -------------------------------------------------------------------------%
59
46
60
- % -------------------------------------------------------------------------%
47
+ % -errorbar thickness-%
48
+ obj.data{plotIndex }.error_y.thickness = plotData .LineWidth ;
49
+ obj.data{plotIndex }.error_x.thickness = plotData .LineWidth ;
61
50
62
- % -errorbar width-%
63
- obj.data{errorbarIndex }.error_y.width = obj .PlotlyDefaults .ErrorbarWidth ;
64
- obj.data{errorbarIndex }.error_x.width = obj .PlotlyDefaults .ErrorbarWidth ;
51
+ % -errorbar width-%
52
+ obj.data{plotIndex }.error_y.width = obj .PlotlyDefaults .ErrorbarWidth ;
53
+ obj.data{plotIndex }.error_x.width = obj .PlotlyDefaults .ErrorbarWidth ;
65
54
66
- % -------------------------------------------------------------------------%
55
+ % -errorbar color-%
56
+ errorColor = getStringColor(255 * plotData .Color );
57
+ obj.data{plotIndex }.error_y.color = errorColor ;
58
+ obj.data{plotIndex }.error_x.color = errorColor ;
67
59
68
- % -errorbar color-%
69
- col = 255 * errorbar_data .Color ;
70
- obj.data{errorbarIndex }.error_y.color = [' rgb(' num2str(col(1 )) ' ,' num2str(col(2 )) ' ,' num2str(col(3 )) ' )' ];
71
- obj.data{errorbarIndex }.error_x.color = [' rgb(' num2str(col(1 )) ' ,' num2str(col(2 )) ' ,' num2str(col(3 )) ' )' ];
60
+ % -------------------------------------------------------------------------%
72
61
73
- % -------------------------------------------------------------------------%
74
-
75
- end
62
+ end
63
+
0 commit comments