code: def redraw(self, event=None):
      if self.ignore_redraw:
          return
      for vw_row in self.image_rows + self.object_rows + self.mask_rows:
          vw_row.update()
      if not self.frame.figure.canvas.IsShown():
          self.frame.figure.canvas.Show()
          self.layout()
      #
      # Remove all the old text labels
      #
      to_remove = []
      for artist in list(self.axes.texts):
          artist.remove()
  
      m = self.workspace.measurements
      assert isinstance(m, Measurements)
      title_lines = []
      object_values = {}
      for measurement_row in self.measurement_rows:
          assert isinstance(
              measurement_row, WorkspaceViewMeasurementRow
          )
          if not measurement_row.should_show():
              continue
          object_name = measurement_row.get_object_name()
          if (
              object_name is None
              or object_name not in m.get_object_names()
          ):
              continue
          feature = measurement_row.get_measurement_name()
          if feature is None or not m.has_feature(object_name, feature):
              continue
  
          value = m[object_name, feature]
          if object_name in (
              IMAGE,
              EXPERIMENT,
          ):
              if isinstance(value, int):
                  fmt = "%s: %d"
              elif isinstance(value, float):
                  fmt = "%s: %.4f"
              else:
                  fmt = "%s: %s"
              title_lines.append(fmt % (feature, value))
          else:
              if object_name not in object_values:
                  if any(
                      [
                          not m.has_feature(object_name, lf)
                          for lf in (
                              M_LOCATION_CENTER_X,
                              M_LOCATION_CENTER_Y,
                          )
                      ]
                  ):
                      continue
                  object_values[object_name] = []
              object_values[object_name].append(
                  (value, measurement_row)
              )
      if len(title_lines) > 0:
          self.axes.set_title("\n".join(title_lines))
      else:
          self.axes.set_title("Image set # %d" % m.image_number)
      for object_name, value_rows in list(object_values.items()):
          values = [vr[0] for vr in value_rows]
          measurement_rows = [vr[1] for vr in value_rows]
          x, y = [
              m[object_name, ftr]
              for ftr in (
                  M_LOCATION_CENTER_X,
                  M_LOCATION_CENTER_Y,
              )
          ]
          for i in range(len(x)):
              xi, yi = x[i], y[i]
              if numpy.isnan(xi) or numpy.isnan(yi):
                  continue
              height = 0
              for j, measurement_row in enumerate(measurement_rows):
                  if len(values[j]) <= i or (
                      not isinstance(values[j][i], str)
                      and numpy.isnan(values[j][i])
                  ):
                      continue
                  value = values[j][i]
                  font = measurement_row.font
                  if font.GetStyle() == wx.ITALIC:
                      fontstyle = "italic"
                  else:
                      fontstyle = "normal"
                  color = measurement_row.foreground_color
                  fontcolor, backgroundcolor = [
                      tuple([float(c) / 255 for c in color][:3])
                      for color in (
                          measurement_row.foreground_color,
                          measurement_row.background_color,
                      )
                  ]
                  if not isinstance(value, str):
                      fmt = "%%.%df" % measurement_row.precision
                      value = fmt % value
                  a = self.axes.annotate(
                      value,
                      (xi, yi),
                      xytext=(0, -height),
                      textcoords="offset points",
                      ha="center",
                      va="center",
                      bbox={
                          "boxstyle": measurement_row.box_style,
                          "fc": backgroundcolor,
                          "alpha": measurement_row.background_alpha,
                      },
                      color=fontcolor,
                      family=font.GetFaceName(),
                      fontsize=font.GetPointSize(),
                      fontstyle=fontstyle,
                      weight=font.GetWeight(),
                  )
                  height += font.GetPointSize() + 1
  
      self.scale_axes()
      self.frame.figure.canvas.draw()
  
imports: import matplotlib
  import matplotlib.axes
  import numpy
  import wx
  import wx.lib.scrolledpanel
  from cellprofiler_core.constants.measurement import EXPERIMENT
  from cellprofiler_core.constants.measurement import IMAGE
  from cellprofiler_core.constants.measurement import M_LOCATION_CENTER_X
  from cellprofiler_core.constants.measurement import M_LOCATION_CENTER_Y
  from cellprofiler_core.measurement import Measurements
  from cellprofiler_core.preferences import IM_BILINEAR
  from cellprofiler_core.preferences import get_primary_outline_color
  from cellprofiler_core.preferences import get_secondary_outline_color
  from cellprofiler_core.preferences import get_tertiary_outline_color
  from cellprofiler_core.preferences import IM_NEAREST
  from cellprofiler_core.preferences import get_interpolation_mode
  from ..artist import INTERPOLATION_BILINEAR
  from ..artist import INTERPOLATION_NEAREST
  from ..artist import INTERPOLATION_BICUBIC
  from ..artist import MODE_HIDE
  from ..artist import CPImageArtist
  from ..constants.workspace_view import C_CHOOSER, WORKSPACE_VIEWER_HELP
  from ..constants.workspace_view import C_COLOR
  from ..constants.workspace_view import C_SHOW
  from ..constants.workspace_view import C_REMOVE
  from ..help.content import FIGURE_HELP
  from ..html.utils import rst_to_html_fragment
  from ..htmldialog import HTMLDialog
  from ._workspace_view_figure import WorkspaceViewFigure
  from ._workspace_view_image_row import WorkspaceViewImageRow
  from ._workspace_view_mask_row import WorkspaceViewMaskRow
  from ._workspace_view_measurement_row import WorkspaceViewMeasurementRow
  from ._workspace_view_objects_row import WorkspaceViewObjectsRow
label_desc: Use image node_id 18 for calling the WorkspaceView obj's underlying member method code with example usage: obj.redraw(event) without return types