I’m trying to create a 2x2 subplot of 3D surface plots in MATLAB R2024b and export to HTML. However, in the HTML, all four subplots are plotted on top of each other in the upper left tile. See code below. I’ve found that it subplot HTML conversion works fine for 2D plot types (e.g. line, scatter) but not for 3D. I’ve also tried running the example given on the doc page (3d subplots in MATLAB) but I see the same issue. Is there a workaround you can share, or a fix in the pipeline?
Thank you!
clc
clear
close all
fig1 = figure;
[X,Y,Z] = peaks(25);
fig1.Units = ‘pixels’;
fig1.Position = [0 0 1920 1080];
t = tiledlayout(“flow”);
t.TileSpacing = “tight”;
title(‘MyTitle’);
for i = 1:4
subplot(2,2,i);
surf(X, Y, Z);
title(‘My Title’);
xlabel(‘X’);
ylabel(‘Y’);
zlabel(‘Z’);
end
p = fig2plotly(gcf, ‘filename’, ‘interactive_surf_plot’, ‘offline’, true);