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

조회 수: 7 (최근 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 CenterFile Exchange에서 Polar Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by