Skip to content

Commit 6c6e84f

Browse files
Merge pull request #274 from plotly/issue244
fix issue #244
2 parents 6a30c05 + edabea0 commit 6c6e84f

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

plotly/plotlyfig_aux/handlegraphics/updateLineseries.m

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,18 @@ function updateLineseries(obj,plotIndex)
6565

6666
%-------------------------------------------------------------------------%
6767

68-
%-if compass or not-%
69-
iscompass = false;
68+
%-if polar plot or not-%
69+
ispolar = false;
7070
x = plot_data.XData;
7171
y = plot_data.YData;
7272

7373
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;
7580
end
7681

7782
%-------------------------------------------------------------------------%
@@ -89,7 +94,7 @@ function updateLineseries(obj,plotIndex)
8994
%-scatter type-%
9095
obj.data{plotIndex}.type = 'scatter';
9196

92-
if iscompass
97+
if ispolar
9398
obj.data{plotIndex}.type = 'scatterpolar';
9499
end
95100

@@ -102,7 +107,7 @@ function updateLineseries(obj,plotIndex)
102107

103108
%-scatter x-%
104109

105-
if iscompass
110+
if ispolar
106111
r = sqrt(x.^2 + y.^2);
107112
obj.data{plotIndex}.r = r;
108113
else
@@ -112,7 +117,7 @@ function updateLineseries(obj,plotIndex)
112117
%-------------------------------------------------------------------------%
113118

114119
%-scatter y-%
115-
if iscompass
120+
if ispolar
116121
theta = atan2(x,y);
117122
obj.data{plotIndex}.theta = -(rad2deg(theta) - 90);
118123
else

0 commit comments

Comments
 (0)