File tree 1 file changed +11
-6
lines changed
plotly/plotlyfig_aux/handlegraphics
1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -65,13 +65,18 @@ function updateLineseries(obj,plotIndex)
65
65
66
66
% -------------------------------------------------------------------------%
67
67
68
- % -if compass or not-%
69
- iscompass = false ;
68
+ % -if polar plot or not-%
69
+ ispolar = false ;
70
70
x = plot_data .XData ;
71
71
y = plot_data .YData ;
72
72
73
73
if length(x )==5 && length(y )==5 && x(2 )==x(4 ) && y(2 )==y(4 )
74
- iscompass = true ;
74
+ ispolar = true ;
75
+ end
76
+
77
+ % -if polar ezplot or not-%
78
+ if abs(x(1 )-x(end ))<1e- 5 && abs(y(1 )-y(end ))<1e- 5
79
+ ispolar = true ;
75
80
end
76
81
77
82
% -------------------------------------------------------------------------%
@@ -89,7 +94,7 @@ function updateLineseries(obj,plotIndex)
89
94
% -scatter type-%
90
95
obj.data{plotIndex }.type = ' scatter' ;
91
96
92
- if iscompass
97
+ if ispolar
93
98
obj.data{plotIndex }.type = ' scatterpolar' ;
94
99
end
95
100
@@ -102,7 +107,7 @@ function updateLineseries(obj,plotIndex)
102
107
103
108
% -scatter x-%
104
109
105
- if iscompass
110
+ if ispolar
106
111
r = sqrt(x .^ 2 + y .^ 2 );
107
112
obj.data{plotIndex }.r = r ;
108
113
else
@@ -112,7 +117,7 @@ function updateLineseries(obj,plotIndex)
112
117
% -------------------------------------------------------------------------%
113
118
114
119
% -scatter y-%
115
- if iscompass
120
+ if ispolar
116
121
theta = atan2(x ,y );
117
122
obj.data{plotIndex }.theta = -(rad2deg(theta ) - 90 );
118
123
else
You can’t perform that action at this time.
0 commit comments