File tree 2 files changed +29
-2
lines changed
plotlyfig_aux/handlegraphics
2 files changed +29
-2
lines changed Original file line number Diff line number Diff line change @@ -898,6 +898,7 @@ function delete(obj)
898
898
if ~( ...
899
899
strcmpi(fieldname ,' surface' ) || strcmpi(fieldname ,' scatter3d' ) ...
900
900
|| strcmpi(fieldname ,' mesh3d' ) || strcmpi(fieldname ,' bar' ) ...
901
+ || strcmpi(fieldname ,' scatterpolar' ) ...
901
902
)
902
903
fprintf([' \n Whoops! ' exception .message(1 : end - 1 ) ' in ' fieldname ' \n\n ' ]);
903
904
end
Original file line number Diff line number Diff line change @@ -65,6 +65,17 @@ function updateLineseries(obj,plotIndex)
65
65
66
66
% -------------------------------------------------------------------------%
67
67
68
+ % -if compass or not-%
69
+ iscompass = false ;
70
+ x = plot_data .XData ;
71
+ y = plot_data .YData ;
72
+
73
+ if length(x )==5 && length(y )==5 && x(2 )==x(4 ) && y(2 )==y(4 )
74
+ iscompass = true ;
75
+ end
76
+
77
+ % -------------------------------------------------------------------------%
78
+
68
79
% -scatter xaxis-%
69
80
obj.data{plotIndex }.xaxis = [' x' num2str(xsource )];
70
81
@@ -78,6 +89,10 @@ function updateLineseries(obj,plotIndex)
78
89
% -scatter type-%
79
90
obj.data{plotIndex }.type = ' scatter' ;
80
91
92
+ if iscompass
93
+ obj.data{plotIndex }.type = ' scatterpolar' ;
94
+ end
95
+
81
96
% -------------------------------------------------------------------------%
82
97
83
98
% -scatter visible-%
@@ -86,12 +101,23 @@ function updateLineseries(obj,plotIndex)
86
101
% -------------------------------------------------------------------------%
87
102
88
103
% -scatter x-%
89
- obj.data{plotIndex }.x = plot_data .XData ;
104
+
105
+ if iscompass
106
+ r = sqrt(x .^ 2 + y .^ 2 );
107
+ obj.data{plotIndex }.r = r ;
108
+ else
109
+ obj.data{plotIndex }.x = x ;
110
+ end
90
111
91
112
% -------------------------------------------------------------------------%
92
113
93
114
% -scatter y-%
94
- obj.data{plotIndex }.y = plot_data .YData ;
115
+ if iscompass
116
+ theta = atan2(x ,y );
117
+ obj.data{plotIndex }.theta = -(rad2deg(theta ) - 90 );
118
+ else
119
+ obj.data{plotIndex }.y = plot_data .YData ;
120
+ end
95
121
96
122
% -------------------------------------------------------------------------%
97
123
You can’t perform that action at this time.
0 commit comments