ROTATING TEXTARROW in 3D
Show older comments
Dear All,
I am trying to find a way, to rotate the textarrow, that correspond to its data in the pie chart, what I called h2 in that code, I want to rotate the text appearing with its arrow, for example the following string : "particle1- 13%", that actually points to a specific part of the pie chart (related data), therefore when I rotate the pie chart in 3D, I want the arrow and the text to rotate in the same way, while still pointing to the same data (part of the pie chart). I tried to do something very simple, like using rotate(h2, [20 20], 360/n]); but it is not working and it generates the following error : "Error using rotate (line 33), H must contain axes children only."
thanks in advance for your help
figure1=figure('units','normalized','outerposition',[0 0 1 1]);
colormap(parula(10))
h= pie3(mat_data3(:,1), explode, repmat({''}, size(mat_data3(:,1))));
h2=annotation(figure1,'textarrow',[0.503125 0.503645833333333],...
[0.123595505617978 0.426966292134832],'String',{'particle1- 13 %'});
% Create textarrow
annotation(figure1,'textarrow',[0.3359375 0.371875],...
[0.724813727070731 0.726418863507328],'String',{'particle2- 4 %'});
% Create textarrow
annotation(figure1,'textarrow',[0.350520833333333 0.390625],...
[0.771043759243553 0.76141294062397],'String',{'particle3- 11 %'});
% Create textarrow
annotation(figure1,'textarrow',[0.372395833333333 0.409375],...
[0.802054784918726 0.773162329059978],'String',{'particle4- 1 %'});
% Create textarrow
annotation(figure1,'textarrow',[0.413541666666667 0.430208333333333],...
[0.827866640498503 0.784527956710381],'String',{'particle5- 1 %'});
% Create textarrow
annotation(figure1,'textarrow',[0.4390625 0.459375],...
[0.856986899563319 0.786516853932584],'String',{'particle6- 26 %'});
% Create textarrow
annotation(figure1,'textarrow',[0.530729166666667 0.516145833333333],...
[0.863563402889246 0.798034934497817],'String',{'particle7- 42 %'});
% Create textarrow
annotation(figure1,'textarrow',[0.561979166666667 0.540104166666667],...
[0.820960698689956 0.776200873362445],'String',{'particle8- 1 %'});
h1=title('Average Particle Occurrence', 'fontsize', 15);
n = 180;
mov(n) = getframe;
for i = 1:n
rotate(h, [20 20], 360 / n);
rotate(h1, [20 20], 360 / n);
rotate(h2, [20 20], 360 / n);
mov(i) = getframe;
end
Accepted Answer
More Answers (0)
Categories
Find more on Annotations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!