When I am trying to subplot using for loop. I am getting this error. However, the curve is getting plotted correctly. Please suggest what's the matter
3 次查看(过去 30 天)
显示 更早的评论
Unrecognized method, property, or field 'InteractionsManager' for class 'matlab.graphics.primitive.canvas.JavaCanvas'.
Error in matlab.graphics.internal.FigureToolstripManager.addGCAInteractions (line 504)
can.InteractionsManager.registerInteraction(ax(k),inter{end});
Error in matlab.graphics.internal.FigureToolstripManager>@()matlab.graphics.internal.FigureToolstripManager.addGCAInteractions(f,d.Child) (line 586)
@(e,d) matlab.graphics.internal.drawnow.callback(@() matlab.graphics.internal.FigureToolstripManager.addGCAInteractions(f, d.Child)));
2 个评论
dpb
2021-6-28
Looks like a problem in the Java engine -- which release and is this a new install of MATLAB by any chance?
回答(1 个)
Isaac Bruss
2021-6-29
I am able to recreate this error only in MATLAB Online by running the following .m file from the command line:
subplot(2,1,1)
image(imread('cameraman.tif'));title('Anything');axis equal tight;
subplot(2,1,2)
image(imread('cameraman.tif'));title('test image');hold on;axis equal tight;
I'm looking into this.
1 个评论
Isaac Bruss
2021-6-29
While we look into this specific issue, you might try tiledlayout. This is a new and preferred workflow for creating multiple figures. The code would look something like the following:
tiledlayout(2,1)
nexttile
image(imread('cameraman.tif'));title('Anything');axis equal tight;
nexttile
image(imread('cameraman.tif'));title('test image');hold on;axis equal tight;
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Subplots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!