File tree Expand file tree Collapse file tree 2 files changed +29
-2
lines changed
plotlyfig_aux/handlegraphics Expand file tree Collapse file tree 2 files changed +29
-2
lines changed Original file line number Diff line number Diff line change @@ -898,6 +898,7 @@ function delete(obj)
898898 if ~( ...
899899 strcmpi(fieldname ,' surface' ) || strcmpi(fieldname ,' scatter3d' ) ...
900900 || strcmpi(fieldname ,' mesh3d' ) || strcmpi(fieldname ,' bar' ) ...
901+ || strcmpi(fieldname ,' scatterpolar' ) ...
901902 )
902903 fprintf([' \n Whoops! ' exception .message(1 : end - 1 ) ' in ' fieldname ' \n\n ' ]);
903904 end
Original file line number Diff line number Diff line change @@ -65,6 +65,17 @@ function updateLineseries(obj,plotIndex)
6565
6666% -------------------------------------------------------------------------%
6767
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+
6879% -scatter xaxis-%
6980obj.data{plotIndex }.xaxis = [' x' num2str(xsource )];
7081
@@ -78,6 +89,10 @@ function updateLineseries(obj,plotIndex)
7889% -scatter type-%
7990obj.data{plotIndex }.type = ' scatter' ;
8091
92+ if iscompass
93+ obj.data{plotIndex }.type = ' scatterpolar' ;
94+ end
95+
8196% -------------------------------------------------------------------------%
8297
8398% -scatter visible-%
@@ -86,12 +101,23 @@ function updateLineseries(obj,plotIndex)
86101% -------------------------------------------------------------------------%
87102
88103% -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
90111
91112% -------------------------------------------------------------------------%
92113
93114% -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
95121
96122% -------------------------------------------------------------------------%
97123
You can’t perform that action at this time.
0 commit comments