code: def plot_raw_psd(
      raw,
      fmin=0,
      fmax=np.inf,
      tmin=None,
      tmax=None,
      proj=False,
      n_fft=None,
      n_overlap=0,
      reject_by_annotation=True,
      picks=None,
      ax=None,
      color="black",
      xscale="linear",
      area_mode="std",
      area_alpha=0.33,
      dB=True,
      estimate="auto",
      show=True,
      n_jobs=None,
      average=False,
      line_alpha=None,
      spatial_colors=True,
      sphere=None,
      window="hamming",
      exclude="bads",
      verbose=None,
  ):
      """%(plot_psd_doc)s.
  
      Parameters
      ----------
      raw : instance of Raw
          The raw object.
      %(fmin_fmax_psd)s
      %(tmin_tmax_psd)s
      %(proj_psd)s
      n_fft : int | None
          Number of points to use in Welch FFT calculations. Default is ``None``,
          which uses the minimum of 2048 and the number of time points.
      n_overlap : int
          The number of points of overlap between blocks. The default value
          is 0 (no overlap).
      %(reject_by_annotation_psd)s
      %(picks_good_data_noref)s
      %(ax_plot_psd)s
      %(color_plot_psd)s
      %(xscale_plot_psd)s
      %(area_mode_plot_psd)s
      %(area_alpha_plot_psd)s
      %(dB_plot_psd)s
      %(estimate_plot_psd)s
      %(show)s
      %(n_jobs)s
      %(average_plot_psd)s
      %(line_alpha_plot_psd)s
      %(spatial_colors_psd)s
      %(sphere_topomap_auto)s
      %(window_psd)s
  
          .. versionadded:: 0.22.0
      exclude : list of str | 'bads'
          Channels names to exclude from being shown. If 'bads', the bad channels
          are excluded. Pass an empty list to plot all channels (including
          channels marked "bad", if any).
  
          .. versionadded:: 0.24.0
      %(verbose)s
  
      Returns
      -------
      fig : instance of Figure
          Figure with frequency spectra of the data channels.
  
      Notes
      -----
      %(notes_plot_*_psd_func)s
      """
      from ..time_frequency import Spectrum
  
      init_kw, plot_kw = _split_psd_kwargs(plot_fun=Spectrum.plot)
      return raw.compute_psd(**init_kw).plot(**plot_kw)
  
file_path: mne-python/mne/viz/raw.py
imports: from collections import OrderedDict
  import numpy
  from .._fiff.pick import pick_channels, pick_types
  from ..defaults import _handle_default
  from ..filter import create_filter
  from ..utils import _check_option, _get_stim_channel, _validate_type, legacy, verbose
  from ..utils.spectrum import _split_psd_kwargs
  from .utils import _check_cov, _compute_scalings, _get_channel_plotting_order, _handle_decim, _handle_precompute, _make_event_color_dict, _shorten_path_from_middle
label_desc: Use image node_id 2 for calling a global function with example usage: plot_raw_psd(raw, fmin, fmax, tmin, tmax, proj, n_fft, n_overlap, reject_by_annotation, picks, ax, color, xscale, area_mode, area_alpha, dB, estimate, show, n_jobs, average, line_alpha, spatial_colors, sphere, window, exclude, verbose) and returns: raw