File tree Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -1797,3 +1797,24 @@ def test_set_offset_string(formatter):
1797
1797
assert formatter .get_offset () == ''
1798
1798
formatter .set_offset_string ('mpl' )
1799
1799
assert formatter .get_offset () == 'mpl'
1800
+
1801
+
1802
+ def test_minorticks_on_multi_fig ():
1803
+ """
1804
+ Turning on minor gridlines in a multi-Axes Figure
1805
+ that contains more than one boxplot and shares the x-axis
1806
+ should not raise an exception.
1807
+ """
1808
+ fig , ax = plt .subplots ()
1809
+
1810
+ ax .boxplot (np .arange (10 ), positions = [0 ])
1811
+ ax .boxplot (np .arange (10 ), positions = [0 ])
1812
+ ax .boxplot (np .arange (10 ), positions = [1 ])
1813
+
1814
+ ax .grid (which = "major" )
1815
+ ax .grid (which = "minor" )
1816
+ ax .minorticks_on ()
1817
+ fig .draw_without_rendering ()
1818
+
1819
+ assert ax .get_xgridlines ()
1820
+ assert isinstance (ax .xaxis .get_minor_locator (), mpl .ticker .AutoMinorLocator )
Original file line number Diff line number Diff line change @@ -2895,7 +2895,7 @@ def __call__(self):
2895
2895
'logarithmic scale' )
2896
2896
return []
2897
2897
2898
- majorlocs = self .axis .get_majorticklocs ()
2898
+ majorlocs = np . unique ( self .axis .get_majorticklocs () )
2899
2899
try :
2900
2900
majorstep = majorlocs [1 ] - majorlocs [0 ]
2901
2901
except IndexError :
You can’t perform that action at this time.
0 commit comments