class_docstr: Visualizes a policy in an environment.
class_docstr_tok: ["Visualizes","a","policy","in","an","environment","."]
docstr: Initialize the plotter.
  
  Args:
      env (GymEnv): Environment to visualize.
      policy (Policy): Policy to roll out in the
          visualization.
docstr_tok: ["Initialize","the","plotter",".","Args",":","env","(","GymEnv",")",":","Environment","to","visualize",".","policy","(","Policy",")",":","Policy","to","roll","out","in","the","visualization","."]
code: def init_plot(self, env, policy):
      """Initialize the plotter.
  
      Args:
          env (GymEnv): Environment to visualize.
          policy (Policy): Policy to roll out in the
              visualization.
  
      """
      if not Plotter.enable:
          return
      if not (self._process and self._queue):
          self._init_worker()
  
      # Needed in order to draw glfw window on the main thread
      if "Darwin" in platform.platform():
          rollout(env, policy, max_episode_length=np.inf, animated=True)
  
      self._queue.put(
          Message(op=Op.UPDATE, args=(env, policy), kwargs=None)
      )
  
file_path: garage/src/garage/plotter/plotter.py
imports: import atexit
  from collections import namedtuple
  from enum import Enum
  from multiprocessing import JoinableQueue, Process
  import platform
  from threading import Thread
  import numpy
  from garage import rollout
label_desc: Use image node_id 7 for calling the Plotter obj's underlying member method code with example usage: obj.init_plot(env, policy) without return types