gcpy.plot.single_panel
- gcpy.plot.single_panel(plot_vals, ax=None, plot_type='single_level', grid=None, gridtype='', title='fill', comap=<matplotlib.colors.ListedColormap object>, norm=None, unit='', extent=None, masked_data=None, use_cmap_RdBu=False, log_color_scale=False, add_cb=True, pres_range=None, pedge=array([[-1]]), pedge_ind=array([[-1]]), log_yaxis=False, xtick_positions=None, xticklabels=None, proj=<Projected CRS: +proj=eqc +ellps=WGS84 +a=6378137.0 +lon_0=0.0 +to ...> Name: unknown Axis Info [cartesian]: - E[east]: Easting (unknown) - N[north]: Northing (unknown) - h[up]: Ellipsoidal height (metre) Area of Use: - undefined Coordinate Operation: - name: unknown - method: Equidistant Cylindrical Datum: Unknown based on WGS 84 ellipsoid - Ellipsoid: WGS 84 - Prime Meridian: Greenwich, sg_path='', ll_plot_func='imshow', vert_params=None, pdfname='', weightsdir='.', vmin=None, vmax=None, return_list_of_plots=False, **extra_plot_args)[source]
Core plotting routine – creates a single plot panel.
- Parameters:
plot_vals (
xarray.DataArrayornumpy.ndarrayordask.array.Array) – Single data variable GEOS-Chem output to plot.ax (
matplotlib.axes.Axes, optional) – Axes object to plot information. Default value: None (will create a new axes)plot_type (
str, optional) – Either “single_level” or “zonal_mean”. Default value: “single_level”grid (
dict, optional) – Dictionary mapping plot_vals to plottable coordinates. Default value: {} (will attempt to read grid from plot_vals)gridtype (
str, optional) – “ll” for lat/lon or “cs” for cubed-sphere. Default value: “” (will automatically determine from grid)title (
str, optional) – Title to put at top of plot. Default value: “fill” (will use name attribute of plot_vals if available)comap (
matplotlib.colors.Colormap, optional) – Colormap for plotting data values. Default value: WhGrYlRdnorm (
list, optional) – List with range [0..1] normalizing color range for matplotlib methods. Default value: None (will determine from plot_vals)unit (
str, optional) – Units of plotted data. Default value: “” (will use units attribute of plot_vals if available)extent (
tupleoffloat, optional) – Describes minimum and maximum latitude and longitude of input data in the form (minlon, maxlon, minlat, maxlat). Default value: None (will use full extent of plot_vals if plot is single level)masked_data (
numpy.ndarray, optional) – Masked area for avoiding near-dateline cubed-sphere plotting issues. Default value: None (will attempt to determine from plot_vals)use_cmap_RdBu (
bool, optional) – Set this flag to True to use a blue-white-red colormap. Default value: Falselog_color_scale (
bool, optional) – Set this flag to True to use a log-scale colormap. Default value: Falseadd_cb (
bool, optional) – Set this flag to True to add a colorbar to the plot. Default value: Truepres_range (
listofint, optional) – Range from minimum to maximum pressure for zonal mean plotting. Default value: [0, 2000] (will plot entire atmosphere)pedge (
numpy.ndarray, optional) – Edge pressures of vertical grid cells in plot_vals for zonal mean plotting. Default value: np.full((1, 1), -1) (will determine automatically)pedge_ind (
numpy.ndarray, optional) – Index of edge pressure values within pressure range in plot_vals for zonal mean plotting. Default value: np.full((1, 1), -1) (will determine automatically)log_yaxis (
bool, optional) – Set this flag to True to enable log scaling of pressure in zonal mean plots. Default value: Falsextick_positions (
listoffloat, optional) – Locations of lat/lon or lon ticks on plot. Default value: None (will place automatically for zonal mean plots)xticklabels (
listofstr, optional) – Labels for lat/lon ticks. Default value: None (will determine automatically from xtick_positions)proj (
cartopy.crs.Projection, optional) – Projection for plotting data. Default value: ccrs.PlateCarree()sg_path (
str, optional) – Path to NetCDF file containing stretched-grid info (in attributes) for plot_vals. Default value: ‘’ (will not be read in)ll_plot_func (
str, optional) – Function to use for lat/lon single level plotting with possible values ‘imshow’ and ‘pcolormesh’. imshow is much faster but is slightly displaced when plotting from dateline to dateline and/or pole to pole. Default value: ‘imshow’vert_params (
listofarray-like, optional) – Hybrid grid parameter A in hPa and B (unitless). Needed if grid is not 47 or 72 levels. Default value: Nonepdfname (
str, optional) – File path to save plots as PDF. Default value: “” (will not create PDF)weightsdir (
str, optional) – Directory path for storing regridding weights. Default value: “.” (will store regridding files in current directory)vmin (
float, optional) – Minimum for colorbars. Default value: None (will use plot value minimum)vmax (
float, optional) – Maximum for colorbars. Default value: None (will use plot value maximum)return_list_of_plots (
bool, optional) – Return plots as a list. This is helpful if you are using a cubed-sphere grid and would like access to all 6 plots. Default value: False**extra_plot_args – Any extra keyword arguments are passed to calls to pcolormesh() (CS) or imshow() (Lat/Lon).
- Returns:
plot – Plot object created from input.
- Return type: