フィルターのクリア

How to copy polar plots to subplots in a new figure?

6 ビュー (過去 30 日間)
Peter
Peter 2020 年 5 月 21 日
編集済み: Peter 2020 年 5 月 21 日
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 件)

カテゴリ

Help Center および File ExchangePolar Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by