def test_show(set_agg_backend): """Test that show works properly.""" pc = PanelContainer() # Matplotlib warns when using show with Agg with warnings.catch_warnings(): warnings.simplefilter('ignore', UserWarning) pc.show()
def test_show(): """Test that show works properly.""" pc = PanelContainer() # Matplotlib warns when using show with Agg with warnings.catch_warnings(): warnings.simplefilter('ignore', UserWarning) pc.show()
wind_geo = PlotGeometry() wind_geo.geometry = wind_data['geometry'] wind_geo.fill = wind_data['fill'] wind_geo.stroke = 'none' ########################### # Plot the cities from the 'geometry' column, marked with diamonds ('D'). Label each point # with the name of the city, and it's probability of tropical-storm-force winds on the line # below. Points are set to plot in white and the font color is set to black. city_geo = PlotGeometry() city_geo.geometry = cities['geometry'] city_geo.marker = 'D' city_geo.labels = cities['NAME'] + '\n(' + cities['PERCENTAGE'] + ')' city_geo.fill = 'white' city_geo.label_facecolor = 'black' ########################### # Add the geometry plots to a panel and container. Finally, we are left with a complete plot of # wind speed probabilities, along with some select cities and their specific probabilities. panel = MapPanel() panel.title = 'NHC 5-Day Tropical-Storm-Force Wind Probabilities (Valid 12z Aug 20 2021)' panel.plots = [wind_geo, city_geo] panel.area = [-90, -52, 27, 48] panel.projection = 'mer' panel.layers = ['lakes', 'land', 'ocean', 'states', 'coastline', 'borders'] pc = PanelContainer() pc.size = (12, 10) pc.panels = [panel] pc.show()
# Distributed under the terms of the BSD 3-Clause License. # SPDX-License-Identifier: BSD-3-Clause """ Simple Plotting =============== Demonstrate the use of MetPy's simplified plotting interface. Plots a sample satellite image file. """ import xarray as xr from metpy.cbook import get_test_data from metpy.io import GiniFile from metpy.plots import ImagePlot, MapPanel, PanelContainer data = xr.open_dataset(GiniFile(get_test_data('NHEM-MULTICOMP_1km_IR_20151208_2100.gini'))) img = ImagePlot() img.data = data img.field = 'IR' img.colormap = 'Greys_r' panel = MapPanel() panel.plots = [img] pc = PanelContainer() pc.panels = [panel] pc.show()