How to copy polar plots to subplots in a new figure?
9 次查看(过去 30 天)
显示 更早的评论
I have multiple figures with polar plots open, and I'm trying to copy each of them to subplots in a single figure. I cannot figure out how to do this.
This is what I'm currently trying. It throws error "PolarAxes cannot be a child of PolarAxes."
I use similar code to copy Cartesian plots, in which I just use subplot, instead of this polarSubPlot. If I use that when trying to copy a polar plot to the subplot, I instead get error ""PolarAxes cannot be a child of Axes."
What should they be a child of? Is my (new) subplot object wrong, or do I have the wrong object from my existing plot?
figHandles = get(groot, 'Children');
for i=1:length(figHandles)
hSub = polarSubPlot(rowCount,colCount,i);
axesPolar = get(figHandles(i),'children');
copyobj(axesPolar,hSub) %Error: "PolarAxes cannot be a child of PolarAxes."
end
function [polarAxisHandle] = polarSubPlot(rows,columns,index)
axesHandle(index) = subplot(rows,columns,index);
polarAxesHandles = polaraxes('Units',axesHandle(index).Units,'Position',axesHandle(index).Position);
polarAxisHandle = polarAxesHandles(index);
delete(axesHandle(index));
end
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Polar Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!