Skip to content

Commit d7de67e

Browse files
Add FunctionSurfacePlot test
1 parent 47e9d9f commit d7de67e

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

plotly/Test_plotlyfig.m

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1557,6 +1557,37 @@ function testContour3PlotData(tc)
15571557
), AbsTol=1e-15);
15581558
end
15591559

1560+
function testFunctionSurfacePlotData(tc)
1561+
fig = figure("Visible","off");
1562+
fsurf(@(x,y) sin(x).*cos(y), [-pi pi -pi pi]);
1563+
1564+
p = plotlyfig(fig,"visible","off");
1565+
1566+
tc.verifyNumElements(p.data, 2);
1567+
tc.verifyEqual(rmfield(p.data{1}, ["colorscale" "x" "y" "z" "surfacecolor"]), struct( ...
1568+
"scene", 'scene1', ...
1569+
"type", 'surface', ...
1570+
"opacity", 1, ...
1571+
"name", '{sin}({x}) {cos}({y})', ...
1572+
"showscale", false, ...
1573+
"visible", true, ...
1574+
"showlegend", true ...
1575+
));
1576+
tc.verifyEqual(rmfield(p.data{2}, ["x" "y" "z"]), struct( ...
1577+
"scene", 'scene1', ...
1578+
"type", 'scatter3d', ...
1579+
"mode", 'lines', ...
1580+
"line", struct( ...
1581+
"color", "rgb(0,0,0)", ...
1582+
"width", 1.5, ...
1583+
"dash", 'solid' ...
1584+
), ...
1585+
"name", '{sin}({x}) {cos}({y})', ...
1586+
"showscale", false, ...
1587+
"visible", true ...
1588+
));
1589+
end
1590+
15601591
function testTitleFont(tc)
15611592
fig = figure("Visible","off");
15621593
x = 1:10;

0 commit comments

Comments
 (0)