Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1d4e83e

Browse files
Add stairs plot data test
1 parent 4966523 commit 1d4e83e

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

plotly/Test_plotlyfig.m

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -551,6 +551,43 @@ function testPieChartPlotData(tc)
551551
), AbsTol=1e-4);
552552
end
553553

554+
function testStairsPlotData(tc)
555+
fig = figure("Visible","off");
556+
x = 2:2:8;
557+
y = [1 1 2 2];
558+
stairs(x,y,'-or')
559+
560+
p = plotlyfig(fig,"visible","off");
561+
562+
tc.verifyNumElements(p.data, 1);
563+
tc.verifyEqual(p.data{1}, struct( ...
564+
"type", "scatter", ...
565+
"xaxis", "x1", ...
566+
"yaxis", "y1", ...
567+
"visible", true, ...
568+
"name", '', ...
569+
"mode", 'lines+markers', ...
570+
"x", x, ...
571+
"y", y, ...
572+
"line", struct( ...
573+
"color", "rgb(255,0,0)", ...
574+
"width", 0.5, ...
575+
"dash", 'solid', ...
576+
"shape", "hv" ...
577+
), ...
578+
"marker", struct( ...
579+
"size", 3.6, ...
580+
"symbol", "circle", ...
581+
"line", struct( ...
582+
"width", 0.5, ...
583+
"color", "rgb(255,0,0)" ...
584+
), ...
585+
"color", "rgba(0,0,0,0)" ...
586+
), ...
587+
"showlegend", false ...
588+
), AbsTol=1e-4);
589+
end
590+
554591
function testPlotmatrixData(tc)
555592
fig = figure("Visible","off");
556593
columns = [ ...

0 commit comments

Comments
 (0)