55 Union ,
66)
77
8+ import matplotlib as mpl
89from matplotlib .axes import Axes
910from matplotlib .figure import Figure
1011import matplotlib .pyplot as plt
1314import numpy .typing as npt
1415import pandas as pd
1516from pandas import Series
17+ from pandas .util .version import Version
1618import pytest
1719from typing_extensions import assert_type
1820
@@ -577,13 +579,22 @@ def test_plot_keywords(close_figures):
577579 )
578580
579581 df = pd .DataFrame (np .random .rand (10 , 5 ), columns = ["A" , "B" , "C" , "D" , "E" ])
580- check (
581- assert_type (
582- df .plot (kind = "box" , orientation = "vertical" , positions = [1 , 4 , 5 , 6 , 8 ]),
582+ if Version (mpl .__version__ ) >= Version ("3.10.1" ):
583+ check (
584+ assert_type (
585+ df .plot (kind = "box" , orientation = "vertical" , positions = [1 , 4 , 5 , 6 , 8 ]),
586+ Axes ,
587+ ),
583588 Axes ,
584- ),
585- Axes ,
586- )
589+ )
590+ else :
591+ check (
592+ assert_type (
593+ df .plot (kind = "box" , vert = False , positions = [1 , 4 , 5 , 6 , 8 ]),
594+ Axes ,
595+ ),
596+ Axes ,
597+ )
587598
588599
589600def test_plot_subplot_changes_150 () -> None :
@@ -609,7 +620,7 @@ def test_grouped_dataframe_boxplot(close_figures):
609620 check (assert_type (grouped .boxplot (subplots = True ), Series ), Series )
610621
611622 # a single plot
612- if not PD_LTE_22 :
623+ if not PD_LTE_22 and Version ( mpl . __version__ ) >= Version ( "3.10.1" ) :
613624 check (
614625 assert_type (
615626 grouped .boxplot (
@@ -654,7 +665,7 @@ def test_grouped_dataframe_boxplot_single(close_figures):
654665 Axes ,
655666 )
656667
657- if not PD_LTE_22 :
668+ if not PD_LTE_22 and Version ( mpl . __version__ ) >= Version ( "3.10.1" ) :
658669 check (
659670 assert_type (
660671 grouped .boxplot (
0 commit comments