@@ -1564,149 +1564,176 @@ def test_boxplot_bad_ci_2():
1564
1564
fig , ax = plt .subplots ()
1565
1565
assert_raises (ValueError , ax .boxplot , [x , x ],
1566
1566
conf_intervals = [[1 , 2 ], [1 ]])
1567
+
1568
+
1567
1569
# violin plot data initialization
1568
1570
ax = plt .axes ()
1569
- data = [([ 0.07902449 , - 0.16769639 , 1.1572525 , 0.71400729 , - 0.17916727 ,
1570
- - 1.15346725 , - 0.5298936 , 1.16570619 , 1.13612837 , - 0.66830221 ,
1571
- - 0.76738509 , 0.85911678 , 0.56446469 , 0.64772651 , - 1.97432723 ,
1572
- - 1.11794413 , 0.4094635 , 2.52767469 , - 0.81092698 , - 0.23422668 ,
1573
- 0.423861 , 0.01702886 , - 0.58954823 , - 1.05303546 , 0.22632754 ,
1574
- - 1.88620214 , 0.06759594 , - 0.51663253 , - 0.38821442 , - 0.5462294 ,
1575
- - 0.39967334 , - 1.2690421 , - 0.271953 , 0.19494831 , 1.0674446 ,
1576
- 0.06632929 , 0.9051155 , - 0.06507299 , - 0.58885588 , 0.03405925 ,
1577
- 0.60666877 , - 0.25755542 , 1.06387913 , - 0.50576651 , - 0.51104135 ,
1578
- - 0.65366091 , - 1.10801137 , 0.55746182 , 0.27206281 , 0.25658797 ,
1579
- 0.008253 , - 0.07254077 , - 0.77980703 , - 1.5707303 , - 0.74731452 ,
1580
- - 0.38364682 , 1.37653142 , - 0.04123221 , - 0.84737153 , 0.26552353 ,
1581
- 0.80039697 , 0.17446856 , 0.32860543 , 0.79574814 , - 1.88942134 ]),
1582
- ([ 3.99586977e-01 , 1.09626020e+00 , 2.64974356e-01 ,5.49065532e-01 ,
1583
- - 1.86679220e+00 , - 4.23951661e-01 , - 3.66858136e-01 ,7.39441772e-02 ,
1584
- - 1.25772592e+00 , - 1.14864510e+00 , - 7.59625813e-01 ,- 2.67830782e-01 ,
1585
- - 2.68205909e-01 , - 2.64119550e-02 , - 3.00092210e-01 ,- 1.17080290e-03 ,
1586
- 1.25324397e+00 , 1.97518726e-01 , 9.74395138e-01 , - 2.52217468e-01 ,
1587
- - 2.00424239e+00 , - 2.20525681e+00 , 6.32069078e-01 , - 5.59674009e-02 ,
1588
- - 1.13007054e+00 , 8.47680697e-01 , - 1.41563783e+00 , 6.84885681e-02 ,
1589
- 8.06629024e-01 , 1.06561293e+00 , 1.48755064e-01 , 1.06241336e+00 ,
1590
- - 1.53742677e+00 , - 9.40116707e-01 , - 2.35342351e-01 , 4.07790960e-01 ,
1591
- 9.59066810e-01 , 1.83262266e+00 , - 1.44675794e-01 , - 1.61663789e+00 ,
1592
- - 3.34055942e-01 , - 1.65081542e+00 , 6.54573563e-01 , - 4.80998938e-01 ,
1593
- - 4.77104620e-01 , 4.35836897e-01 , 1.54488583e-01 , 1.90264111e+00 ,
1594
- - 1.73584727e+00 , 2.84097580e-01 , - 6.67013428e-01 , - 5.47647643e-01 ,
1595
- - 1.77584471e-01 , - 6.54191064e-01 , 1.02366976e+00 , 1.57777769e+00 ,
1596
- 2.10098337e-01 , - 5.34631915e-02 , 4.28913084e-01 , - 5.56544884e-02 ,
1597
- 1.64250239e-01 , - 4.77299164e-01 , - 8.40402132e-01 , - 1.58474541e-01 ]),
1598
- ([- 0.00975961 , - 0.9572654 , - 0.02331628 , - 0.88758431 , 0.36594918 ,
1599
- 0.58733922 , 0.12169127 , - 0.17451044 , - 1.48322656 , - 0.64203124 ,
1600
- 1.01373274 , - 0.77332978 , - 1.64093613 , 0.07944897 , 1.79420792 ,
1601
- - 0.95589844 , - 2.19618124 , 0.99478738 , - 1.98933911 , 0.21046525 ,
1602
- - 2.31831045 , 1.11045528 , - 0.51981581 , 0.49740564 , - 0.40365721 ,
1603
- - 0.30515722 , - 0.60601737 , - 1.05976064 , 1.43356283 , - 0.59014164 ,
1604
- 0.58822025 , 1.80100922 , - 1.40905671 , 0.74553523 , - 1.57655404 ,
1605
- 0.29342432 , 0.35548625 , - 0.99138976 , - 1.37339981 , 0.63871936 ,
1606
- - 0.60010678 , - 0.73597695 , - 0.12228469 , 0.2467333 , 0.03750118 ,
1607
- - 0.45755544 , - 0.8648646 , 0.13883081 , - 0.11239293 , - 0.7661388 ,
1608
- - 0.70841112 , - 0.51668825 , 2.2590876 , 0.61731299 , - 0.33742898 ,
1609
- 1.40708783 , - 1.43371511 , - 1.20425544 , 0.79551956 , - 0.38148021 ,
1610
- - 0.05703633 , - 0.42718744 , 1.86441201 , - 0.36006341 , - 2.23769144 ]),
1611
- ([ 0.28379466 , 0.31202331 , 0.54110464 , 0.79957469 , 0.02825945 ,
1612
- 1.39430266 , 0.38945253 , 0.25840893 , - 1.03405387 , 0.3951418 ,
1613
- - 0.32782812 , - 0.49764761 , 1.67314785 , 0.57207158 , 0.42868172 ,
1614
- - 0.66405633 , 0.49477738 , - 0.24707622 , - 0.91179434 , - 0.88450974 ,
1615
- 1.47387423 , 1.27147423 , - 1.28664994 , 0.84428091 , 0.19419244 ,
1616
- - 1.27527008 , 1.44462176 , 1.21255381 , 1.74448494 , - 1.47661372 ,
1617
- - 1.00577117 , - 0.68746569 , - 0.85283125 , - 0.87339905 , - 0.05053922 ,
1618
- 1.79110014 , - 0.99663248 , 0.52435397 , 1.17699107 , - 1.51437376 ,
1619
- 0.52402067 , - 0.68885234 , 1.84101899 , 1.09318846 , 0.66686321 ,
1620
- - 1.14796045 , 0.54247117 , - 2.21273401 , - 0.44526518 , 1.08591603 ,
1621
- - 1.86173825 , - 1.31016714 , 0.7782744 , 0.76330906 , - 0.96452241 ,
1622
- - 1.34983597 , - 0.90317774 , 0.20187156 , - 2.03515866 , 1.35603702 ,
1623
- 1.01390851 , 0.29328188 , - 0.2223719 , - 1.29928072 , 0.59399753 ])]
1571
+ data = [([+ 0.07902449 , - 0.16769639 , + 1.1572525 , + 0.71400729 , - 0.17916727 ,
1572
+ - 1.15346725 , - 0.5298936 , + 1.16570619 , + 1.13612837 , - 0.66830221 ,
1573
+ - 0.76738509 , + 0.85911678 , + 0.56446469 , + 0.64772651 , - 1.97432723 ,
1574
+ - 1.11794413 , + 0.4094635 , + 2.52767469 , - 0.81092698 , - 0.23422668 ,
1575
+ + 0.423861 , + 0.01702886 , - 0.58954823 , - 1.05303546 , + 0.22632754 ,
1576
+ - 1.88620214 , + 0.06759594 , - 0.51663253 , - 0.38821442 , - 0.5462294 ,
1577
+ - 0.39967334 , - 1.2690421 , - 0.271953 , + 0.19494831 , + 1.0674446 ,
1578
+ + 0.06632929 , + 0.9051155 , - 0.06507299 , - 0.58885588 , + 0.03405925 ,
1579
+ + 0.60666877 , - 0.25755542 , + 1.06387913 , - 0.50576651 , - 0.51104135 ,
1580
+ - 0.65366091 , - 1.10801137 , + 0.55746182 , + 0.27206281 , + 0.25658797 ,
1581
+ + 0.008253 , - 0.07254077 , - 0.77980703 , - 1.5707303 , - 0.74731452 ,
1582
+ - 0.38364682 , + 1.37653142 , - 0.04123221 , - 0.84737153 , + 0.26552353 ,
1583
+ + 0.80039697 , + 0.17446856 , + 0.32860543 , + 0.79574814 , - 1.88942134 ]),
1584
+ ([+ 3.99586977e-01 , + 1.09626020e+00 , + 2.64974356e-01 , + 5.49065532e-01 ,
1585
+ - 1.86679220e+00 , - 4.23951661e-01 , - 3.66858136e-01 , + 7.39441772e-02 ,
1586
+ - 1.25772592e+00 , - 1.14864510e+00 , - 7.59625813e-01 , - 2.67830782e-01 ,
1587
+ - 2.68205909e-01 , - 2.64119550e-02 , - 3.00092210e-01 , - 1.17080290e-03 ,
1588
+ + 1.25324397e+00 , + 1.97518726e-01 , + 9.74395138e-01 , - 2.52217468e-01 ,
1589
+ - 2.00424239e+00 , - 2.20525681e+00 , + 6.32069078e-01 , - 5.59674009e-02 ,
1590
+ - 1.13007054e+00 , + 8.47680697e-01 , - 1.41563783e+00 , + 6.84885681e-02 ,
1591
+ + 8.06629024e-01 , + 1.06561293e+00 , + 1.48755064e-01 , + 1.06241336e+00 ,
1592
+ - 1.53742677e+00 , - 9.40116707e-01 , - 2.35342351e-01 , + 4.07790960e-01 ,
1593
+ + 9.59066810e-01 , + 1.83262266e+00 , - 1.44675794e-01 , - 1.61663789e+00 ,
1594
+ - 3.34055942e-01 , - 1.65081542e+00 , + 6.54573563e-01 , - 4.80998938e-01 ,
1595
+ - 4.77104620e-01 , + 4.35836897e-01 , + 1.54488583e-01 , + 1.90264111e+00 ,
1596
+ - 1.73584727e+00 , + 2.84097580e-01 , - 6.67013428e-01 , - 5.47647643e-01 ,
1597
+ - 1.77584471e-01 , - 6.54191064e-01 , + 1.02366976e+00 , + 1.57777769e+00 ,
1598
+ + 2.10098337e-01 , - 5.34631915e-02 , + 4.28913084e-01 , - 5.56544884e-02 ,
1599
+ + 1.64250239e-01 , - 4.77299164e-01 , - 8.40402132e-01 , - 1.58474541e-01 ]),
1600
+ ([- 0.00975961 , - 0.9572654 , - 0.02331628 , - 0.88758431 , + 0.36594918 ,
1601
+ + 0.58733922 , + 0.12169127 , - 0.17451044 , - 1.48322656 , - 0.64203124 ,
1602
+ + 1.01373274 , - 0.77332978 , - 1.64093613 , + 0.07944897 , + 1.79420792 ,
1603
+ - 0.95589844 , - 2.19618124 , + 0.99478738 , - 1.98933911 , + 0.21046525 ,
1604
+ - 2.31831045 , + 1.11045528 , - 0.51981581 , + 0.49740564 , - 0.40365721 ,
1605
+ - 0.30515722 , - 0.60601737 , - 1.05976064 , + 1.43356283 , - 0.59014164 ,
1606
+ + 0.58822025 , + 1.80100922 , - 1.40905671 , + 0.74553523 , - 1.57655404 ,
1607
+ + 0.29342432 , + 0.35548625 , - 0.99138976 , - 1.37339981 , + 0.63871936 ,
1608
+ - 0.60010678 , - 0.73597695 , - 0.12228469 , + 0.2467333 , + 0.03750118 ,
1609
+ - 0.45755544 , - 0.8648646 , + 0.13883081 , - 0.11239293 , - 0.7661388 ,
1610
+ - 0.70841112 , - 0.51668825 , + 2.2590876 , + 0.61731299 , - 0.33742898 ,
1611
+ + 1.40708783 , - 1.43371511 , - 1.20425544 , + 0.79551956 , - 0.38148021 ,
1612
+ - 0.05703633 , - 0.42718744 , + 1.86441201 , - 0.36006341 , - 2.23769144 ]),
1613
+ ([+ 0.28379466 , + 0.31202331 , + 0.54110464 , + 0.79957469 , + 0.02825945 ,
1614
+ + 1.39430266 , + 0.38945253 , + 0.25840893 , - 1.03405387 , + 0.3951418 ,
1615
+ - 0.32782812 , - 0.49764761 , + 1.67314785 , + 0.57207158 , + 0.42868172 ,
1616
+ - 0.66405633 , + 0.49477738 , - 0.24707622 , - 0.91179434 , - 0.88450974 ,
1617
+ + 1.47387423 , + 1.27147423 , - 1.28664994 , + 0.84428091 , + 0.19419244 ,
1618
+ - 1.27527008 , + 1.44462176 , + 1.21255381 , + 1.74448494 , - 1.47661372 ,
1619
+ - 1.00577117 , - 0.68746569 , - 0.85283125 , - 0.87339905 , - 0.05053922 ,
1620
+ + 1.79110014 , - 0.99663248 , + 0.52435397 , + 1.17699107 , - 1.51437376 ,
1621
+ + 0.52402067 , - 0.68885234 , + 1.84101899 , + 1.09318846 , + 0.66686321 ,
1622
+ - 1.14796045 , + 0.54247117 , - 2.21273401 , - 0.44526518 , + 1.08591603 ,
1623
+ - 1.86173825 , - 1.31016714 , + 0.7782744 , + 0.76330906 , - 0.96452241 ,
1624
+ - 1.34983597 , - 0.90317774 , + 0.20187156 , - 2.03515866 , + 1.35603702 ,
1625
+ + 1.01390851 , + 0.29328188 , - 0.2223719 , - 1.29928072 , + 0.59399753 ])]
1626
+
1624
1627
1625
1628
# violin plot test starts here
1626
1629
@image_comparison (baseline_images = ['test_vert_violinplot_baseline' ])
1627
1630
def test_vert_violinplot_baseline ():
1628
1631
ax = plt .axes ()
1629
- ax .violinplot (data ,range (4 ),showmeans = 0 ,showextrema = 0 ,showmedians = 0 )
1632
+ ax .violinplot (data , positions = range (4 ), showmeans = 0 , showextrema = 0 ,
1633
+ showmedians = 0 )
1634
+
1630
1635
1631
1636
@image_comparison (baseline_images = ['test_vert_violinplot_showmeans' ])
1632
1637
def test_vert_violinplot_showmeans ():
1633
1638
ax = plt .axes ()
1634
- ax .violinplot (data ,range (4 ),showmeans = 1 ,showextrema = 0 ,showmedians = 0 )
1639
+ ax .violinplot (data , positions = range (4 ), showmeans = 1 , showextrema = 0 ,
1640
+ showmedians = 0 )
1641
+
1635
1642
1636
1643
@image_comparison (baseline_images = ['test_vert_violinplot_showextrema' ])
1637
1644
def test_vert_violinplot_showextrema ():
1638
1645
ax = plt .axes ()
1639
- ax .violinplot (data ,range (4 ),showmeans = 0 ,showextrema = 1 ,showmedians = 0 )
1646
+ ax .violinplot (data , positions = range (4 ), showmeans = 0 , showextrema = 1 ,
1647
+ showmedians = 0 )
1648
+
1640
1649
1641
1650
@image_comparison (baseline_images = ['test_vert_violinplot_showmedians' ])
1642
1651
def test_vert_violinplot_showmedians ():
1643
1652
ax = plt .axes ()
1644
- ax .violinplot (data ,range (4 ),showmeans = 0 ,showextrema = 0 ,showmedians = 1 )
1653
+ ax .violinplot (data , positions = range (4 ), showmeans = 0 , showextrema = 0 ,
1654
+ showmedians = 1 )
1655
+
1645
1656
1646
1657
@image_comparison (baseline_images = ['test_vert_violinplot_showall' ])
1647
1658
def test_vert_violinplot_showall ():
1648
1659
ax = plt .axes ()
1649
- ax .violinplot (data ,range (4 ),showmeans = 1 ,showextrema = 1 ,showmedians = 1 )
1660
+ ax .violinplot (data , positions = range (4 ), showmeans = 1 , showextrema = 1 ,
1661
+ showmedians = 1 )
1650
1662
1651
1663
1652
1664
@image_comparison (baseline_images = ['test_vert_violinplot_custompoints_10' ])
1653
1665
def test_vert_violinplot_custompoints_10 ():
1654
1666
ax = plt .axes ()
1655
- ax .violinplot (data ,range (4 ),showmeans = 0 ,showextrema = 0 ,showmedians = 0 ,points = 10 )
1667
+ ax .violinplot (data , positions = range (4 ), showmeans = 0 , showextrema = 0 ,
1668
+ showmedians = 0 , points = 10 )
1656
1669
1657
1670
1658
1671
@image_comparison (baseline_images = ['test_vert_violinplot_custompoints_200' ])
1659
1672
def test_vert_violinplot_custompoints_200 ():
1660
1673
ax = plt .axes ()
1661
- ax .violinplot (data ,range (4 ),showmeans = 0 ,showextrema = 0 ,showmedians = 0 ,points = 200 )
1674
+ ax .violinplot (data , positions = range (4 ), showmeans = 0 , showextrema = 0 ,
1675
+ showmedians = 0 , points = 200 )
1676
+
1662
1677
1663
1678
@image_comparison (baseline_images = ['test_horiz_violinplot_baseline' ])
1664
1679
def test_horiz_violinplot_baseline ():
1665
1680
ax = plt .axes ()
1666
- ax .violinplot (data ,range (4 ),0 ,showmeans = 0 ,showextrema = 0 ,showmedians = 0 )
1681
+ ax .violinplot (data , positions = range (4 ), vert = False , showmeans = 0 ,
1682
+ showextrema = 0 , showmedians = 0 )
1683
+
1667
1684
1668
1685
@image_comparison (baseline_images = ['test_horiz_violinplot_showmedians' ])
1669
1686
def test_horiz_violinplot_showmedians ():
1670
1687
ax = plt .axes ()
1671
- ax .violinplot (data ,range (4 ),0 ,showmeans = 0 ,showextrema = 0 ,showmedians = 1 )
1688
+ ax .violinplot (data , positions = range (4 ), vert = False , showmeans = 0 ,
1689
+ showextrema = 0 , showmedians = 1 )
1690
+
1672
1691
1673
1692
@image_comparison (baseline_images = ['test_horiz_violinplot_showmeans' ])
1674
1693
def test_horiz_violinplot_showmeans ():
1675
1694
ax = plt .axes ()
1676
- ax .violinplot (data ,range (4 ),0 ,showmeans = 1 ,showextrema = 0 ,showmedians = 0 )
1695
+ ax .violinplot (data , positions = range (4 ), vert = False , showmeans = 1 ,
1696
+ showextrema = 0 , showmedians = 0 )
1697
+
1677
1698
1678
1699
@image_comparison (baseline_images = ['test_horiz_violinplot_showextrema' ])
1679
1700
def test_horiz_violinplot_showextrema ():
1680
1701
ax = plt .axes ()
1681
- ax .violinplot (data ,range (4 ),0 ,showmeans = 0 ,showextrema = 1 ,showmedians = 0 )
1702
+ ax .violinplot (data , positions = range (4 ), vert = False , showmeans = 0 ,
1703
+ showextrema = 1 , showmedians = 0 )
1682
1704
1683
1705
1684
1706
@image_comparison (baseline_images = ['test_horiz_violinplot_showall' ])
1685
1707
def test_horiz_violinplot_showall ():
1686
1708
ax = plt .axes ()
1687
- ax .violinplot (data ,range (4 ),0 ,showmeans = 1 ,showextrema = 1 ,showmedians = 1 )
1709
+ ax .violinplot (data , positions = range (4 ), vert = False , showmeans = 1 ,
1710
+ showextrema = 1 , showmedians = 1 )
1688
1711
1689
1712
1690
1713
@image_comparison (baseline_images = ['test_horiz_violinplot_custompoints_10' ])
1691
1714
def test_horiz_violinplot_custompoints_10 ():
1692
1715
ax = plt .axes ()
1693
- ax .violinplot (data ,range (4 ),0 ,showmeans = 0 ,showextrema = 0 ,showmedians = 0 ,points = 10 )
1716
+ ax .violinplot (data , positions = range (4 ), vert = False , showmeans = 0 ,
1717
+ showextrema = 0 , showmedians = 0 , points = 10 )
1694
1718
1695
1719
1696
1720
@image_comparison (baseline_images = ['test_horiz_violinplot_custompoints_200' ])
1697
1721
def test_horiz_violinplot_custompoints_200 ():
1698
1722
ax = plt .axes ()
1699
- ax .violinplot (data ,range (4 ),0 ,showmeans = 0 ,showextrema = 0 ,showmedians = 0 ,points = 200 )
1723
+ ax .violinplot (data , positions = range (4 ), vert = False , showmeans = 0 ,
1724
+ showextrema = 0 , showmedians = 0 , points = 200 )
1725
+
1700
1726
1701
1727
# test error
1702
1728
def test_violinplot_bad_positions ():
1703
1729
ax = plt .axes ()
1704
1730
assert_raises (ValueError , ax .violinplot , data , positions = range (5 ))
1705
1731
1732
+
1706
1733
def test_violinplot_bad_widths ():
1707
1734
ax = plt .axes ()
1708
- assert_raises (ValueError , ax .violinplot , data ,
1709
- positions = range ( 4 ), widths = [1 ,2 , 3 ])
1735
+ assert_raises (ValueError , ax .violinplot , data , positions = range ( 4 ),
1736
+ widths = [1 , 2 , 3 ])
1710
1737
1711
1738
# violin plot test ends here
1712
1739
0 commit comments