@@ -455,6 +455,38 @@ def test_polar_coord_annotations():
455455 ax .set_ylim (- 20 , 20 )
456456
457457
458+ @image_comparison (baseline_images = ['polar_alignment' ], extensions = ['png' ])
459+ def test_polar_alignment ():
460+ '''
461+ Test that changing the vertical/horizontal alignment of a polar graph
462+ works as expected '''
463+ ranges = [(0 , 5 ), (0 , 5 )]
464+
465+ angles = np .arange (0 , 360 , 90 )
466+
467+ levels = 5
468+
469+ fig = plt .figure ()
470+
471+ figureSize = [0.1 , 0.1 , 0.8 , 0.8 ]
472+
473+ horizontal = fig .add_axes (figureSize , polar = True , label = 'horizontal' )
474+ vertical = fig .add_axes (figureSize , polar = True , label = 'vertical' )
475+
476+ axes = [horizontal , vertical ]
477+
478+ horizontal .set_thetagrids (angles )
479+
480+ vertical .patch .set_visible (False )
481+
482+ for i in range (2 ):
483+ grid = np .linspace (* ranges [i ], num = levels )
484+ gridValues = [0 , 0.2 , 0.4 , 0.6 , 0.8 , 1 ]
485+ axes [i ].set_rgrids (gridValues , angle = angles [i ],
486+ horizontalalignment = 'left' ,
487+ verticalalignment = 'top' )
488+
489+
458490@image_comparison (baseline_images = ['fill_units' ], extensions = ['png' ],
459491 savefig_kwarg = {'dpi' : 60 })
460492def test_fill_units ():
0 commit comments