@@ -1243,6 +1243,66 @@ function testVerticalConstantLineWithLabel(tc)
1243
1243
tc .verifyTrue(any(cellfun(@(ann ) ann .xanchor == alignment , p .layout .annotations )));
1244
1244
end
1245
1245
1246
+ function testStackedPlotData(tc )
1247
+ fig = figure(" Visible" ," off" );
1248
+ x = 1 : 5 ;
1249
+ a = cos(x );
1250
+ b = exp(x );
1251
+ dt = datetime(2010 ,1 ,1 ) + years(x );
1252
+ tb = table(dt ' ,a ' ,b ' ,VariableNames= [" date" " a" " b" ]);
1253
+ stackedplot(tb );
1254
+
1255
+ p = plotlyfig(fig ," visible" ," off" );
1256
+
1257
+ tc .verifyNumElements(p .data , 3 );
1258
+ tc .verifyEqual(p.data{1 }, struct( ...
1259
+ " type" , ' scatter' , ...
1260
+ " visible" , true , ...
1261
+ " name" , ' date' , ...
1262
+ " xaxis" , ' x1' , ...
1263
+ " yaxis" , ' y1' , ...
1264
+ " x" , x , ...
1265
+ " y" , b ' , ...
1266
+ " mode" , ' lines' , ...
1267
+ " line" , struct( ...
1268
+ " color" , " rgb(0,114,189)" , ...
1269
+ " width" , 0.5 , ...
1270
+ " dash" , ' solid' ...
1271
+ ), ...
1272
+ " showlegend" , false ...
1273
+ ));
1274
+ tc .verifyEqual(p.data{2 }, struct( ...
1275
+ " type" , ' scatter' , ...
1276
+ " visible" , true , ...
1277
+ " name" , ' a' , ...
1278
+ " xaxis" , ' x1' , ...
1279
+ " yaxis" , ' y2' , ...
1280
+ " x" , x , ...
1281
+ " y" , a ' , ...
1282
+ " mode" , ' lines' , ...
1283
+ " line" , struct( ...
1284
+ " color" , " rgb(0,114,189)" , ...
1285
+ " width" , 0.5 , ...
1286
+ " dash" , ' solid' ...
1287
+ ) ...
1288
+ ));
1289
+ tc .verifyEqual(p.data{3 }, struct( ...
1290
+ " type" , ' scatter' , ...
1291
+ " visible" , true , ...
1292
+ " name" , ' b' , ...
1293
+ " xaxis" , ' x1' , ...
1294
+ " yaxis" , ' y3' , ...
1295
+ " x" , x , ...
1296
+ " y" , dt ' , ...
1297
+ " mode" , ' lines' , ...
1298
+ " line" , struct( ...
1299
+ " color" , " rgb(0,114,189)" , ...
1300
+ " width" , 0.5 , ...
1301
+ " dash" , ' solid' ...
1302
+ ) ...
1303
+ ));
1304
+ end
1305
+
1246
1306
function testDoubleYAxisAreaPlotData(tc )
1247
1307
fig = figure(" Visible" ," off" );
1248
1308
x = linspace(0 ,10 );
0 commit comments