Plotting pie charts over GraphPlot
显示 更早的评论
Hi,
I want to plot pie-charts over the nodes of a graph plotted as a GraphPlot object such that the middle of the pie sits exactly at the node.
Hence, I want to do something like this
s = [1 1 1 1 2 2 3 4 4 5 6];
t = [2 3 4 5 3 6 6 5 7 7 7];
G = graph(s,t);
p = plot(G);
and then add an axes and plot a pie chart over one of the nodes with
axes('Position',[?, ?, pie_size, pie_size]);
X = [1 0.5 2.5 2]; pie_chart = pie(X, repmat({''},size(X)));
The ? represent the coordinates of the new plot inside the graph plot.
While I can read out the coordinates of the nodes in the graph plot from p.XData and p.YData, these seem to be relative to the center of the plot in units which are incompatible to any available unit system in the axes function.
Does anyone know of a way to accomplish what I want (possibly also in a different way)?
采纳的回答
更多回答(1 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Pie Charts 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


