@@ -1741,7 +1741,7 @@ function testScatterHistPlotData(tc)
17411741 yaxis = " y2" , ...
17421742 type = " bar" , ...
17431743 name = ' ' , ...
1744- x = [0.8 1.2 ], ...
1744+ x = [1.2 0.8 ], ...
17451745 width = [0.5 0.5 ], ...
17461746 y = [0.25 0.75 ], ...
17471747 orientation = " h" , ...
@@ -1777,6 +1777,45 @@ function testScatterHistPlotData(tc)
17771777 ), AbsTol= 1e- 15 );
17781778 end
17791779
1780+ function testScatterHistPlotLayout(tc )
1781+ fig = figure(Visible = " off" );
1782+ x = [0.15 0.19 0.04 0.64 0.28 0.54 0.70 0.50 0.54 0.45 ];
1783+ y = [0.12 0.49 0.85 0.87 0.27 0.21 0.56 0.64 0.42 0.21 ];
1784+ scatterhist(x ,y );
1785+
1786+ p = plotlyfig(fig ," visible" ," off" );
1787+
1788+ tc .verifyEqual(p .layout .xaxis1 .range , [-0.0549 , 0.9549 ], AbsTol= 1e- 15 );
1789+ tc .verifyEqual(p .layout .xaxis1 .domain , ...
1790+ [fig .Children(4 ).Position(1 ), sum(fig .Children(4 ).Position([1 3 ]))]);
1791+ tc .verifyEqual(p .layout .xaxis1 .anchor , " y1" );
1792+
1793+ tc .verifyEqual(p .layout .yaxis1 .range , [-0.061 , 1.061 ], AbsTol= 1e- 15 );
1794+ tc .verifyEqual(p .layout .yaxis1 .domain , ...
1795+ [fig .Children(4 ).Position(2 ), sum(fig .Children(4 ).Position([2 4 ]))]);
1796+ tc .verifyEqual(p .layout .yaxis1 .anchor , " x1" );
1797+
1798+ tc .verifyEqual(p .layout .xaxis2 .range , [-0.012 , 1.212 ]);
1799+ tc .verifyEqual(p .layout .xaxis2 .domain , ...
1800+ [fig .Children(3 ).Position(1 ), sum(fig .Children(3 ).Position([1 3 ]))]);
1801+ tc .verifyEqual(p .layout .xaxis2 .anchor , " y2" );
1802+
1803+ tc .verifyEqual(p .layout .yaxis2 .range , [-0.061 , 1.061 ], AbsTol= 1e- 15 );
1804+ tc .verifyEqual(p .layout .yaxis2 .domain , ...
1805+ [fig .Children(3 ).Position(2 ), sum(fig .Children(3 ).Position([2 4 ]))]);
1806+ tc .verifyEqual(p .layout .yaxis2 .anchor , " x2" );
1807+
1808+ tc .verifyEqual(p .layout .xaxis3 .range , [-0.0549 , 0.9549 ], AbsTol= 1e- 15 );
1809+ tc .verifyEqual(p .layout .xaxis3 .domain , ...
1810+ [fig .Children(2 ).Position(1 ), sum(fig .Children(2 ).Position([1 3 ]))]);
1811+ tc .verifyEqual(p .layout .xaxis3 .anchor , " y3" );
1812+
1813+ tc .verifyEqual(p .layout .yaxis3 .range , [-0.013333333333333332 , 1.3466666666666667 ]);
1814+ tc .verifyEqual(p .layout .yaxis3 .domain , ...
1815+ [fig .Children(2 ).Position(2 ), sum(fig .Children(2 ).Position([2 4 ]))]);
1816+ tc .verifyEqual(p .layout .yaxis3 .anchor , " x3" );
1817+ end
1818+
17801819 function testGroupedKernelScatterHistPlotData(tc )
17811820 fig = figure(" Visible" ," off" );
17821821 x = [0.15 0.19 0.04 0.64 0.28 0.54 0.70 0.50 0.54 0.45 ];
0 commit comments