1
- from itertools import product
2
1
import platform
2
+ from itertools import product
3
+
4
+ import mpl_toolkits .axes_grid1 .mpl_axes
5
+ import numpy as np
6
+ import pytest
7
+ from mpl_toolkits .axes_grid1 import AxesGrid , Grid , ImageGrid
8
+ from mpl_toolkits .axes_grid1 import axes_size as Size
9
+ from mpl_toolkits .axes_grid1 import host_subplot , make_axes_locatable
10
+ from mpl_toolkits .axes_grid1 .anchored_artists import (AnchoredDirectionArrows ,
11
+ AnchoredSizeBar )
12
+ from mpl_toolkits .axes_grid1 .axes_divider import (
13
+ Divider , HBoxDivider , SubplotDivider , VBoxDivider ,
14
+ make_axes_area_auto_adjustable )
15
+ from mpl_toolkits .axes_grid1 .axes_rgb import RGBAxes
16
+ from mpl_toolkits .axes_grid1 .inset_locator import (BboxConnectorPatch ,
17
+ InsetPosition , inset_axes ,
18
+ mark_inset ,
19
+ zoomed_inset_axes )
20
+ from numpy .testing import assert_array_almost_equal , assert_array_equal
3
21
4
22
import matplotlib as mpl
5
23
import matplotlib .pyplot as plt
6
24
import matplotlib .ticker as mticker
7
25
from matplotlib import cbook
8
26
from matplotlib .backend_bases import MouseEvent
9
27
from matplotlib .colors import LogNorm
28
+ from matplotlib .testing .decorators import (check_figures_equal ,
29
+ image_comparison ,
30
+ remove_ticks_and_titles )
10
31
from matplotlib .transforms import Bbox , TransformedBbox
11
- from matplotlib .testing .decorators import (
12
- check_figures_equal , image_comparison , remove_ticks_and_titles )
13
-
14
- from mpl_toolkits .axes_grid1 import (
15
- axes_size as Size ,
16
- host_subplot , make_axes_locatable ,
17
- Grid , AxesGrid , ImageGrid )
18
- from mpl_toolkits .axes_grid1 .anchored_artists import (
19
- AnchoredSizeBar , AnchoredDirectionArrows )
20
- from mpl_toolkits .axes_grid1 .axes_divider import (
21
- Divider , HBoxDivider , make_axes_area_auto_adjustable , SubplotDivider ,
22
- VBoxDivider )
23
- from mpl_toolkits .axes_grid1 .axes_rgb import RGBAxes
24
- from mpl_toolkits .axes_grid1 .inset_locator import (
25
- zoomed_inset_axes , mark_inset , inset_axes , BboxConnectorPatch ,
26
- InsetPosition )
27
- import mpl_toolkits .axes_grid1 .mpl_axes
28
-
29
- import pytest
30
-
31
- import numpy as np
32
- from numpy .testing import assert_array_equal , assert_array_almost_equal
33
32
34
33
35
34
def test_divider_append_axes ():
@@ -698,23 +697,11 @@ def test_imagegrid():
698
697
assert isinstance (cb .locator , mticker .LogLocator )
699
698
700
699
701
- < << << << HEAD
702
- def test_removal ():
703
- import matplotlib .pyplot as plt
704
- import mpl_toolkits .axisartist as AA
705
- fig = plt .figure ()
706
- ax = host_subplot (111 , axes_class = AA .Axes , figure = fig )
707
- col = ax .fill_between (range (5 ), 0 , range (5 ))
708
- fig .canvas .draw ()
709
- col .remove ()
710
- fig .canvas .draw ()
711
- @image_comparison (['anchored_locator_base_call.png' ], style = "classic" )
712
- == == == =
713
- @image_comparison (['anchored_locator_base_call.png' ],style = 'classic' )
714
- > >> >> >> 06 dc554ff0 ... issue test runs but fails comparison
700
+ @image_comparison (['anchored_locator_base_call.png' ], style = 'mpl20' )
715
701
def test_anchored_locator_base_call ():
716
- fig = plt .figure (figsize = (3 ,3 ))
717
- fig1 , fig2 = fig .subfigures (nrows = 2 , ncols = 1 , height_ratios = [1 , 1 ], squeeze = True )
702
+ fig = plt .figure (figsize = (3 , 3 ))
703
+ fig1 , fig2 = fig .subfigures (nrows = 2 , ncols = 1 ,
704
+ height_ratios = [1 , 1 ], squeeze = True )
718
705
719
706
ax = fig1 .subplots ()
720
707
ax .set (aspect = 1 , xlim = (- 15 , 15 ), ylim = (- 20 , 5 ))
@@ -728,11 +715,11 @@ def test_anchored_locator_base_call():
728
715
729
716
# colorbar
730
717
cax = inset_axes (axins ,
731
- width = "5%" , # width = 10% of parent_bbox width
732
- height = "100%" , # height : 50%
733
- loc = 'lower left' ,
734
- bbox_to_anchor = (1.05 , 0. , 1 , 1 ),
735
- bbox_transform = axins .transAxes ,
736
- borderpad = 0 ,
737
- )
718
+ width = "5%" , # width = 10% of parent_bbox width
719
+ height = "100%" , # height : 50%
720
+ loc = 'lower left' ,
721
+ bbox_to_anchor = (1.05 , 0. , 1 , 1 ),
722
+ bbox_transform = axins .transAxes ,
723
+ borderpad = 0 )
724
+
738
725
fig .colorbar (im , cax = cax )
0 commit comments