@@ -564,8 +564,8 @@ def draw(self, renderer, extra):
564
564
assert 'aardvark' == art .draw (renderer , extra = 'aardvark' )
565
565
566
566
567
- def test_in_autoscale_true ():
568
- # test autoscale is performed when in_autoscale=True.
567
+ def test_line_in_autoscale_true ():
568
+ # test autoscale is performed when in_autoscale=True for a line .
569
569
fig , ax = plt .subplots ()
570
570
ax .plot ([0 , 1 ])
571
571
ax .plot ([0 , 1 , 2 , 3 ], in_autoscale = True )
@@ -574,11 +574,32 @@ def test_in_autoscale_true():
574
574
assert ax .get_xlim () == ax .get_ylim () == (0 , 3 )
575
575
576
576
577
- def test_in_autoscale_false ():
578
- # test autoscale is not performed when in_autoscale=False.
577
+ def test_line_in_autoscale_false ():
578
+ # test autoscale is not performed when in_autoscale=False for a line .
579
579
fig , ax = plt .subplots ()
580
580
ax .plot ([0 , 1 ])
581
581
ax .plot ([0 , 1 , 2 , 3 ], in_autoscale = False )
582
582
ax .margins (0 )
583
583
ax .autoscale_view ()
584
584
assert ax .get_xlim () == ax .get_ylim () == (0 , 1 ) # The default limits.
585
+
586
+ def test_patch_in_autoscale_true ():
587
+ # test autoscale is performed when in_autoscale=True for a patch.
588
+ fig , ax = plt .subplots ()
589
+ ax .plot ([0 , 1 ])
590
+ ax .bar ([0 , 1 , 2 , 3 ], [0 , 10 , 20 , 30 ], width = 0.5 , in_autoscale = True )
591
+ ax .margins (0 )
592
+ ax .autoscale_view ()
593
+ assert ax .get_xlim () == (- .25 , 3.25 )
594
+ assert ax .get_ylim () == (0 , 30 )
595
+
596
+
597
+ def test_patch_in_autoscale_false ():
598
+ # test autoscale is not performed when in_autoscale=False for a patch.
599
+ fig , ax = plt .subplots ()
600
+ ax .plot ([0 , 1 ])
601
+ ax .bar ([0 , 1 , 2 , 3 ], [0 , 10 , 20 , 30 ], width = 0.5 , in_autoscale = False )
602
+ ax .margins (0 )
603
+ ax .autoscale_view ()
604
+ assert ax .get_xlim () == (0 , 1 )
605
+ assert ax .get_ylim () == (0 , 1 )
0 commit comments