wavespectra.SpecArray.plot#

SpecArray.plot(kind='contourf', normalised=True, logradius=True, as_period=False, rmin=None, rmax=None, show_theta_labels=True, show_radii_labels=True, radii_ticks=None, radii_labels_angle=22.5, radii_labels_size=8, cbar_ticks=[0.01, 0.1, 1.0], cmap='RdBu_r', extend='neither', efth_min=0.001, **kwargs)[source]#

Plot spectra in polar axis.

Args:
  • kind (str): Plot kind, one of (contourf, contour, pcolormesh).

  • normalised (bool): Show efth normalised between 0 and 1.

  • logradius (bool): Set log radii.

  • as_period (bool): Set radii as wave period instead of frequency.

  • rmin (float): Minimum value to clip the radius axis.

  • rmax (float): Maximum value to clip the radius axis.

  • show_theta_labels (bool): Show direction tick labels.

  • show_radii_labels (bool): Show radii tick labels.

  • radii_ticks (array): Tick values for radii.

  • radii_labels_angle (float): Polar angle at which radii labels are positioned.

  • radii_labels_size (float): Fontsize for radii labels.

  • cbar_ticks (array): Tick values for colorbar.

  • cmap (str, obj): Colormap to use.

  • efth_min (float): Clip energy density below this value.

  • kwargs: All extra kwargs are passed to the plotting method defined by kind.

Returns:
  • pobj: The xarray object returned by calling da.plot.{kind}(**kwargs).

Note:
  • If normalised==True, contourf uses a logarithmic colour scale by default.

  • Plot and axes can be redefined from the returned xarray object.

  • Xarray uses the sharex, sharey args to control which panels receive axis labels. In order to set labels for all panels, set these to False.

  • Masking of low values can be done in contourf by setting efth_min larger than the lowest contour level along with extend set to “neither” or “min”.