@@ -1564,149 +1564,176 @@ def test_boxplot_bad_ci_2():
15641564 fig , ax = plt .subplots ()
15651565 assert_raises (ValueError , ax .boxplot , [x , x ],
15661566 conf_intervals = [[1 , 2 ], [1 ]])
1567+
1568+
15671569# violin plot data initialization
15681570ax = 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+
16241627
16251628# violin plot test starts here
16261629@image_comparison (baseline_images = ['test_vert_violinplot_baseline' ])
16271630def test_vert_violinplot_baseline ():
16281631 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+
16301635
16311636@image_comparison (baseline_images = ['test_vert_violinplot_showmeans' ])
16321637def test_vert_violinplot_showmeans ():
16331638 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+
16351642
16361643@image_comparison (baseline_images = ['test_vert_violinplot_showextrema' ])
16371644def test_vert_violinplot_showextrema ():
16381645 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+
16401649
16411650@image_comparison (baseline_images = ['test_vert_violinplot_showmedians' ])
16421651def test_vert_violinplot_showmedians ():
16431652 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+
16451656
16461657@image_comparison (baseline_images = ['test_vert_violinplot_showall' ])
16471658def test_vert_violinplot_showall ():
16481659 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 )
16501662
16511663
16521664@image_comparison (baseline_images = ['test_vert_violinplot_custompoints_10' ])
16531665def test_vert_violinplot_custompoints_10 ():
16541666 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 )
16561669
16571670
16581671@image_comparison (baseline_images = ['test_vert_violinplot_custompoints_200' ])
16591672def test_vert_violinplot_custompoints_200 ():
16601673 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+
16621677
16631678@image_comparison (baseline_images = ['test_horiz_violinplot_baseline' ])
16641679def test_horiz_violinplot_baseline ():
16651680 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+
16671684
16681685@image_comparison (baseline_images = ['test_horiz_violinplot_showmedians' ])
16691686def test_horiz_violinplot_showmedians ():
16701687 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+
16721691
16731692@image_comparison (baseline_images = ['test_horiz_violinplot_showmeans' ])
16741693def test_horiz_violinplot_showmeans ():
16751694 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+
16771698
16781699@image_comparison (baseline_images = ['test_horiz_violinplot_showextrema' ])
16791700def test_horiz_violinplot_showextrema ():
16801701 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 )
16821704
16831705
16841706@image_comparison (baseline_images = ['test_horiz_violinplot_showall' ])
16851707def test_horiz_violinplot_showall ():
16861708 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 )
16881711
16891712
16901713@image_comparison (baseline_images = ['test_horiz_violinplot_custompoints_10' ])
16911714def test_horiz_violinplot_custompoints_10 ():
16921715 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 )
16941718
16951719
16961720@image_comparison (baseline_images = ['test_horiz_violinplot_custompoints_200' ])
16971721def test_horiz_violinplot_custompoints_200 ():
16981722 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+
17001726
17011727# test error
17021728def test_violinplot_bad_positions ():
17031729 ax = plt .axes ()
17041730 assert_raises (ValueError , ax .violinplot , data , positions = range (5 ))
17051731
1732+
17061733def test_violinplot_bad_widths ():
17071734 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 ])
17101737
17111738# violin plot test ends here
17121739
0 commit comments