code: def test_scale_bar(browser_backend):
      """Test scale bar for raw."""
      ismpl = browser_backend.name == "matplotlib"
      sfreq = 1000.0
      t = np.arange(10000) / sfreq
      data = np.sin(2 * np.pi * 10.0 * t)
      # ± 1000 fT, 400 fT/cm, 20 µV
      data = data * np.array([[1000e-15, 400e-13, 20e-6]]).T
      info = create_info(3, sfreq, ("mag", "grad", "eeg"))
      raw = RawArray(data, info)
      fig = raw.plot()
      texts = fig._get_scale_bar_texts()
      assert len(texts) == 3  # ch_type scale-bars
      wants = ("800.0 fT/cm", "2000.0 fT", "40.0 µV")
      assert texts == wants
      if ismpl:
          # 1 green vline, 3 data, 3 scalebars
          assert len(fig.mne.ax_main.lines) == 7
      else:
          assert len(fig.mne.scalebars) == 3
      for data, bar in zip(fig.mne.traces, fig.mne.scalebars.values()):
          y = data.get_ydata()
          y_lims = [y.min(), y.max()]
          bar_lims = bar.get_ydata()
          assert_allclose(y_lims, bar_lims, atol=1e-4)
  
imports: import itertools
  import os
  from copy import deepcopy
  import matplotlib.pyplot
  import numpy
  import pytest
  from matplotlib import backend_bases
  from numpy.testing import assert_allclose
  from mne import Annotations, create_info, pick_types
  from mne._fiff.pick import _DATA_CH_TYPES_ORDER_DEFAULT, _PICK_TYPES_DATA_DICT
  from mne.annotations import _sync_onset
  from mne.datasets import testing
  from mne.io import RawArray
  from mne.utils import _assert_no_instances, _dt_to_stamp, _record_warnings, check_version, get_config, set_config
  from mne.viz import plot_raw, plot_sensors
  from mne.viz.utils import _fake_click, _fake_keypress
label_desc: Use image node_id 10 for calling a global function with example usage: test_scale_bar(browser_backend) without return types