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!