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!