Skip to content

Commit 5ab0586

Browse files
Add testRoseBarpolarData (rose charts must convert to barpolar)
1 parent 9437102 commit 5ab0586

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

plotly/Test_plotlyfig.m

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3275,5 +3275,25 @@ function testPColorHeatmapData(tc)
32753275
tc.verifyFalse(p.data{1}.showscale);
32763276
try close(); catch; end
32773277
end
3278+
3279+
function testRoseBarpolarData(tc)
3280+
% rose petals must convert to barpolar bars (one bar per
3281+
% petal) instead of a polar line loop, so each petal hovers
3282+
% as one unit.
3283+
fig = figure("Visible","off");
3284+
angles = deg2rad(0:30:330);
3285+
rose(angles);
3286+
3287+
p = plotlyfig(fig,"visible","off");
3288+
3289+
tc.verifyNumElements(p.data, 1);
3290+
tc.verifyEqual(p.data{1}.type, "barpolar");
3291+
tc.verifyEqual(p.data{1}.marker.color, PlotlyTestCase.AnyColorString());
3292+
tc.verifyEqual(p.data{1}.marker.line.color, PlotlyTestCase.AnyColorString());
3293+
tc.verifyGreaterThanOrEqual(p.data{1}.marker.line.width, 1);
3294+
tc.verifyEqual(numel(p.data{1}.theta), numel(p.data{1}.r));
3295+
tc.verifyEqual(sum(p.data{1}.r), numel(angles));
3296+
try close(); catch; end
3297+
end
32783298
end
32793299
end

0 commit comments

Comments
 (0)