1
- function updatePolarplot(obj , plotIndex )
1
+ function data = updatePolarplot(obj , plotIndex )
2
2
3
3
% -AXIS INDEX-%
4
4
axIndex = obj .getAxisIndex(obj .State .Plot(plotIndex ).AssociatedAxis);
@@ -10,7 +10,7 @@ function updatePolarplot(obj, plotIndex)
10
10
xsource = findSourceAxis(obj , axIndex );
11
11
12
12
% -ASSOCIATE POLAR-AXES LAYOUT-%
13
- obj. data{ plotIndex } .subplot = sprintf(' polar%d ' , xsource + 1 );
13
+ data.subplot = sprintf(' polar%d ' , xsource + 1 );
14
14
15
15
% -parse plot data-%
16
16
rData = plotData .RData ;
@@ -20,39 +20,39 @@ function updatePolarplot(obj, plotIndex)
20
20
rData = abs(rData );
21
21
22
22
% -scatterpolar trace setting-%
23
- obj. data{ plotIndex } .type = ' scatterpolar' ;
24
- obj. data{ plotIndex } .visible = strcmp(plotData .Visible ,' on' );
25
- obj. data{ plotIndex } .name = plotData .DisplayName ;
23
+ data.type = ' scatterpolar' ;
24
+ data.visible = strcmp(plotData .Visible ,' on' );
25
+ data.name = plotData .DisplayName ;
26
26
27
27
% -set scatterpolar data-%
28
- obj. data{ plotIndex } .r = rData ;
29
- obj. data{ plotIndex } .theta = thetaData ;
28
+ data.r = rData ;
29
+ data.theta = thetaData ;
30
30
31
31
% -trace settings-%
32
32
if ~strcmpi(' none' , plotData .Marker ) ...
33
33
&& ~strcmpi(' none' , plotData .LineStyle )
34
- obj. data{ plotIndex } .mode = ' lines+markers' ;
34
+ data.mode = ' lines+markers' ;
35
35
elseif ~strcmpi(' none' , plotData .Marker )
36
- obj. data{ plotIndex } .mode = ' markers' ;
36
+ data.mode = ' markers' ;
37
37
elseif ~strcmpi(' none' , plotData .LineStyle )
38
- obj. data{ plotIndex } .mode = ' lines' ;
38
+ data.mode = ' lines' ;
39
39
else
40
- obj. data{ plotIndex } .mode = ' none' ;
40
+ data.mode = ' none' ;
41
41
end
42
42
43
- obj. data{ plotIndex } .marker = extractLineMarker(plotData );
44
- obj. data{ plotIndex } .line = extractLineLine(plotData );
45
- obj. data{ plotIndex } .line.width = 2 * obj. data{ plotIndex } .line.width;
43
+ data.marker = extractLineMarker(plotData );
44
+ data.line = extractLineLine(plotData );
45
+ data.line.width = 2 * data .line .width ;
46
46
47
47
% -legend setting-%
48
48
leg = plotData .Annotation ;
49
49
legInfo = leg .LegendInformation ;
50
50
51
51
switch legInfo .IconDisplayStyle
52
52
case ' on'
53
- obj. data{ plotIndex } .showlegend = true ;
53
+ data.showlegend = true ;
54
54
case ' off'
55
- obj. data{ plotIndex } .showlegend = false ;
55
+ data.showlegend = false ;
56
56
end
57
57
58
58
% -set polar axes-%
@@ -88,8 +88,8 @@ function updatePolaraxes(obj, plotIndex)
88
88
polarAxis.domain.y = min([yo yo + h ], 1 );
89
89
90
90
% -setting angular axis-%
91
- gridColor = sprintf( " rgba(%d,%d,%d,%f) " , ...
92
- [ round(255 * axisData .GridColor ) axisData .GridAlpha ] );
91
+ gridColor = getStringColor( ...
92
+ round(255 * axisData .GridColor ), axisData .GridAlpha );
93
93
gridWidth = axisData .LineWidth ;
94
94
thetaLim = thetaAxis .Limits ;
95
95
@@ -114,7 +114,7 @@ function updatePolaraxes(obj, plotIndex)
114
114
polarAxis.radialaxis.title.font.family = matlab2plotlyfont(...
115
115
thetaLabel .FontName );
116
116
polarAxis.radialaxis.title.font.size = thetaLabel .FontSize ;
117
- polarAxis.radialaxis.title.font.color = sprintf( " rgb(%d,%d,%d) " , ...
117
+ polarAxis.radialaxis.title.font.color = getStringColor( ...
118
118
round(255 * thetaLabel .Color ));
119
119
120
120
% -setting radial axis-%
@@ -143,7 +143,7 @@ function updatePolaraxes(obj, plotIndex)
143
143
polarAxis.angularaxis.title.font.family = matlab2plotlyfont(...
144
144
rLabel .FontName );
145
145
polarAxis.angularaxis.title.font.size = rLabel .FontSize ;
146
- polarAxis.angularaxis.title.font.color = sprintf( " rgb(%d,%d,%d) " , ...
146
+ polarAxis.angularaxis.title.font.color = getStringColor( ...
147
147
round(255 * rLabel .Color ));
148
148
149
149
% -angular tick labels settings-%
@@ -162,7 +162,6 @@ function updatePolaraxes(obj, plotIndex)
162
162
163
163
elseif isempty(tickLabels )
164
164
polarAxis.angularaxis.tickvals = tickValues ;
165
-
166
165
else
167
166
polarAxis.angularaxis.tickvals = tickValues ;
168
167
polarAxis.angularaxis.ticktext = tickLabels ;
@@ -180,7 +179,7 @@ function updatePolaraxes(obj, plotIndex)
180
179
polarAxis.angularaxis.tickfont.family = matlab2plotlyfont(...
181
180
thetaAxis .FontName );
182
181
polarAxis.angularaxis.tickfont.size = thetaAxis .FontSize ;
183
- polarAxis.angularaxis.tickfont.color = sprintf( " rgb(%d,%d,%d) " , ...
182
+ polarAxis.angularaxis.tickfont.color = getStringColor( ...
184
183
round(255 * thetaAxis .Color ));
185
184
end
186
185
@@ -193,10 +192,8 @@ function updatePolaraxes(obj, plotIndex)
193
192
showTickLabels = false ;
194
193
polarAxis.radialaxis.showticklabels = showTickLabels ;
195
194
polarAxis.radialaxis.ticks = ' ' ;
196
-
197
195
elseif isempty(tickLabels )
198
196
polarAxis.radialaxis.tickvals = tickValues ;
199
-
200
197
else
201
198
polarAxis.radialaxis.tickvals = tickValues ;
202
199
polarAxis.radialaxis.ticktext = tickLabels ;
@@ -214,7 +211,7 @@ function updatePolaraxes(obj, plotIndex)
214
211
polarAxis.radialaxis.tickfont.family = matlab2plotlyfont(...
215
212
rAxis .FontName );
216
213
polarAxis.radialaxis.tickfont.size = rAxis .FontSize ;
217
- polarAxis.radialaxis.tickfont.color = sprintf( " rgb(%d,%d,%d) " , ...
214
+ polarAxis.radialaxis.tickfont.color = getStringColor( ...
218
215
round(255 * rAxis .Color ));
219
216
end
220
217
0 commit comments