フィルターのクリア

Get handle of subplot with CData

2 ビュー (過去 30 日間)
Christopher Grose
Christopher Grose 2018 年 10 月 18 日
回答済み: Walter Roberson 2018 年 10 月 18 日
The following throws a 'There is no CData property on the Axes class' error, but I don't know how to resolve it.
% initiate figure and get subplot handles
ynum = 100;
xnum = 100;
xgrid = 0:1:(xnum-1);
ygrid = 0:1:(ynum-1);
figure(2); hold on;
subplot(2,2,1); imagesc(xgrid,ygrid,zeros(ynum,xnum)); caxis([0 0.75]); colormap(jet(256)); colorbar; title('0');
subplot(2,2,2); imagesc(xgrid,ygrid,zeros(ynum,xnum)); caxis([0 1.00]); colormap(jet(256)); colorbar; title('phase field (P1)');
subplot(2,2,3); imagesc(xgrid,ygrid,zeros(ynum,xnum)); caxis([0.15 0.85]); colormap(jet(256)); colorbar; title('comp field (A)');
subplot(2,2,4); imagesc(xgrid,ygrid,zeros(ynum,xnum)); caxis([1 1000]); colormap(jet(256)); colorbar; title('crystal field');
handles.img(1) = subplot(2,2,1); truesize;
handles.img(2) = subplot(2,2,2); truesize;
handles.img(3) = subplot(2,2,3); truesize;
handles.img(4) = subplot(2,2,4); truesize;
hold off;
% update figure
for t=1:10
figure(2);
set(handles.img(1),'CData',rand(ynum,xnum)); title(num2str(t));
set(handles.img(2),'CData',rand(ynum,xnum));
set(handles.img(3),'CData',rand(ynum,xnum));
set(handles.img(4),'CData',rand(ynum,xnum));
end

採用された回答

Walter Roberson
Walter Roberson 2018 年 10 月 18 日
subplot(2,2,2); handles.img(2) = imagesc(xgrid,ygrid,zeros(ynum,xnum)); caxis([0 1.00]); colormap(jet(256)); colorbar; title('phase field (P1)');

その他の回答 (0 件)

カテゴリ

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

製品

Community Treasure Hunt

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

Start Hunting!

Translated by