Pie Chart To be Plot in Specified Figure

2 visualizaciones (últimos 30 días)
Thulasi Durai Durai Samy
Thulasi Durai Durai Samy el 4 de Jul. de 2012
Hi, I need to plot the pie chart in a specified figure, i used the following commands
Data = {'GFRP','CFRP','KFRP','GFRP','CFRP','KFRP','KFRP2','CFRP','GFRP'};
[mat_unique,index]=unique(Data,'first');
mat_ratio = countmember(mat_unique,Data);
Mat_graph_fig = figure();
mat_graph_3d = pie(mat_ratio);
GraphObject = findobj(mat_graph_3d,'Type','text');
oldStr = get(GraphObject,{'String'});
newStr = strcat(mat_unique,'(',(oldStr)',')');
%set(GraphObject,{'Parent'},Mat_graph_fig);
Matlab error: ??? Error using ==> set Invalid parameter/value pair arguments
Error in ==> Graph_Material at 17
set(GraphObject,{'Parent'},Mat_graph_fig);
can some body help
Thanks in advance
  1 comentario
Image Analyst
Image Analyst el 4 de Jul. de 2012
I don't understand what you're trying to do with the last 4 lines. Didn't the pie() line do the plot? So what's all the gibberish after it for? Are you trying to set a title, or pie sector labels or something?

Iniciar sesión para comentar.

Respuestas (1)

Walter Roberson
Walter Roberson el 4 de Jul. de 2012
I believe that when you specify a property list as a cell array, then you have to specify a cell array for the corresponding values. Try
set(GraphObject,'Parent',Mat_graph_fig);
Also, text objects cannot be parented to figures: text objects must be parented to an axes.

Categorías

Más información sobre Pie Charts en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by