Skip to content

Plotting error with contourf=True  #10

Description

@xenct

In plot_acs_hazard default behaviour, the map produced is not as expected.
The error does not occur with all data.
The white area is transparent/NaN
The remaining coloured area is not aligned correctly

For example:

from acs_plotting_maps import plot_acs_hazard, regions_dict, cmap_dict, tick_dict
import xarray as xr
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import cartopy.crs as ccrs

ds = xr.open_dataset('/g/data/ia39/ncra/heat/data/HWF/bias-corrected/ensemble/GWL-change/HWF_AGCD-05i_MME50_ssp370_v1-r1-ACS-QME-AGCD-1960-2022_GWL20-GWL12-change.nc')

plot_acs_hazard(data = ds['HWF'],
                        cmap = cmap_dict["anom_coolwarm"],
                        ticks = np.arange(-100,101,20),
                        regions = regions_dict['ncra_regions'],
                        cbar_label = "units",
                        cbar_extend = "both",
                        title = f"Change in ",
                        dataset_name = "INFO",
                        date_range = ds.GWL.replace('degC',u'\N{DEGREE SIGN}C'),
                        watermark=None,
                        outfile = 'temp.png',
                        contour = False,
                        contourf=True,
                        );

expected output:

# turn off contourf and use pcolormesh instead
contourf=False

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions