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)));

回答(1 个)

Isaac Bruss
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
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;

请先登录,再进行评论。

Community Treasure Hunt

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

Start Hunting!

Translated by