code: def test_plot_joint():
      """Test TFR joint plotting."""
      raw = read_raw_fif(raw_fname)
      times = np.linspace(-0.1, 0.1, 200)
      n_freqs = 3
      nave = 1
      rng = np.random.RandomState(42)
      data = rng.randn(len(raw.ch_names), n_freqs, len(times))
      tfr = AverageTFR(raw.info, data, times, np.arange(n_freqs), nave)
  
      topomap_args = {"res": 8, "contours": 0, "sensors": False}
  
      for combine in ("mean", "rms", lambda x: x.mean(axis=0)):
          with catch_logging() as log:
              tfr.plot_joint(
                  title="auto",
                  colorbar=True,
                  combine=combine,
                  topomap_args=topomap_args,
                  verbose="debug",
              )
          plt.close("all")
          log = log.getvalue()
          assert "Plotting topomap for grad data" in log
  
      # check various timefreqs
      for timefreqs in (
          {
              (tfr.times[0], tfr.freqs[1]): (0.1, 0.5),
              (tfr.times[-1], tfr.freqs[-1]): (0.2, 0.6),
          },
          [(tfr.times[1], tfr.freqs[1])],
      ):
          tfr.plot_joint(timefreqs=timefreqs, topomap_args=topomap_args)
          plt.close("all")
  
      # test bad timefreqs
      timefreqs = (
          [(-100, 1)],
          tfr.times[1],
          [1],
          [(tfr.times[1], tfr.freqs[1], tfr.freqs[1])],
      )
      for these_timefreqs in timefreqs:
          pytest.raises(ValueError, tfr.plot_joint, these_timefreqs)
  
      # test that the object is not internally modified
      tfr_orig = tfr.copy()
      tfr.plot_joint(
          baseline=(0, None),
          exclude=[tfr.ch_names[0]],
          topomap_args=topomap_args,
      )
      plt.close("all")
      assert_array_equal(tfr.data, tfr_orig.data)
      assert set(tfr.ch_names) == set(tfr_orig.ch_names)
      assert set(tfr.times) == set(tfr_orig.times)
  
      # test tfr with picked channels
      tfr.pick(tfr.ch_names[:-1])
      tfr.plot_joint(
          title="auto", colorbar=True, topomap_args=topomap_args
      )
  
imports: import datetime
  import re
  from itertools import product
  from pathlib import Path
  import matplotlib.pyplot
  import numpy
  import pytest
  from numpy.testing import assert_allclose, assert_array_equal, assert_equal
  from scipy.signal import morlet2
  import mne
  from mne import Epochs, EpochsArray, Info, Transform, create_info, pick_types, read_events
  from mne.io import read_raw_fif
  from mne.tests.test_epochs import assert_metadata_equal
  from mne.time_frequency import tfr_array_morlet, tfr_array_multitaper
  from mne.time_frequency.tfr import AverageTFR, EpochsTFR, _compute_tfr, _make_dpss, combine_tfr, cwt, fwhm, morlet, read_tfrs, tfr_morlet, tfr_multitaper, write_tfrs
  from mne.utils import catch_logging, grand_average
  from mne.viz.utils import _fake_click, _fake_keypress, _fake_scroll
label_desc: Use image node_id 12 for calling a global function with example usage: test_plot_joint() without return types