@@ -2133,6 +2133,42 @@ def test_declarative_plot_geometry_lines(ccrs):
21332133 return pc .figure
21342134
21352135
2136+ @pytest .mark .mpl_image_compare (remove_text = False , tolerance = 0.013 )
2137+ def test_declarative_plot_geometry_fills (ccrs ):
2138+ """Test that `PlotGeometry` correctly plots MultiLineString and LineString objects."""
2139+ from shapely .geometry import Polygon
2140+
2141+ # MultiPolygons and Polygons to plot
2142+ mdt_risk_polygon = Polygon (
2143+ [(- 87.07 , 31.68 ), (- 88.65 , 30.96 ), (- 91.83 , 30.52 ), (- 92.83 , 30.82 ), (- 93.18 , 31.77 ),
2144+ (- 92.65 , 33.31 ), (- 92.64 , 35.22 ), (- 91.74 , 36.16 ), (- 88.84 , 35.53 ), (- 86.13 , 34.5 ),
2145+ (- 85.45 , 33.01 ), (- 86 , 32.05 ), (- 87.07 , 31.68 )])
2146+ high_risk_polygon = Polygon (
2147+ [(- 91.88 , 32.99 ), (- 89.82 , 34.4 ), (- 88.19 , 34.21 ), (- 87.72 , 33.46 ), (- 88.23 , 32.48 ),
2148+ (- 90.53 , 32 ), (- 91.74 , 32.07 ), (- 91.88 , 32.99 )])
2149+
2150+ # Plot geometry, set colors and labels
2151+ geo = PlotGeometry ()
2152+ geo .geometry = [mdt_risk_polygon , high_risk_polygon ]
2153+ geo .fill = ['#E06666' , '#EE99EE' ]
2154+ geo .stroke = ['#E06666' , '#EE99EE' ]
2155+ geo .labels = None
2156+
2157+ # Place plot in a panel and container
2158+ panel = MapPanel ()
2159+ panel .area = [- 120 , - 75 , 25 , 50 ]
2160+ panel .projection = 'lcc'
2161+ panel .title = ' '
2162+ panel .plots = [geo ]
2163+
2164+ pc = PanelContainer ()
2165+ pc .size = (12 , 12 )
2166+ pc .panels = [panel ]
2167+ pc .draw ()
2168+
2169+ return pc .figure
2170+
2171+
21362172@pytest .mark .mpl_image_compare (remove_text = False , tolerance = 1.900 )
21372173def test_declarative_plot_geometry_points (ccrs ):
21382174 """Test that `PlotGeometry` correctly plots Point and MultiPoint objects."""
0 commit comments