parameters: (booster, fmap='', num_trees=0, rankdir=None, ax=None, **kwargs)
return_statement: return ax
docstring: Plot specified tree.
  
      Parameters
      ----------
      booster : Booster, XGBModel
          Booster or XGBModel instance
      fmap: str (optional)
         The name of feature map file
      num_trees : int, default 0
          Specify the ordinal number of target tree
      rankdir : str, default "TB"
          Passed to graphiz via graph_attr
      ax : matplotlib Axes, default None
          Target axes instance. If None, new figure and axes will be created.
      kwargs :
          Other keywords passed to to_graphviz
  
      Returns
      -------
      ax : matplotlib Axes
docstring_summary: Plot specified tree.
docstring_tokens: Plot specified tree .
function: def plot_tree(booster, fmap='', num_trees=0, rankdir=None, ax=None, **kwargs):
      """Plot specified tree.
  
      Parameters
      ----------
      booster : Booster, XGBModel
          Booster or XGBModel instance
      fmap: str (optional)
         The name of feature map file
      num_trees : int, default 0
          Specify the ordinal number of target tree
      rankdir : str, default "TB"
          Passed to graphiz via graph_attr
      ax : matplotlib Axes, default None
          Target axes instance. If None, new figure and axes will be created.
      kwargs :
          Other keywords passed to to_graphviz
  
      Returns
      -------
      ax : matplotlib Axes
  
      """
      try:
          from matplotlib import pyplot as plt
          from matplotlib import image
      except ImportError as e:
          raise ImportError('You must install matplotlib to plot tree') from e
  
      if ax is None:
          _, ax = plt.subplots(1, 1)
  
      g = to_graphviz(booster, fmap=fmap, num_trees=num_trees, rankdir=rankdir,
                      **kwargs)
  
      s = BytesIO()
      s.write(g.pipe(format='png'))
      s.seek(0)
      img = image.imread(s)
  
      ax.imshow(img)
      ax.axis('off')
      return ax
function_tokens: def plot_tree ( booster , fmap = '' , num_trees = 0 , rankdir = None , ax = None , * * kwargs ) : try : from matplotlib import pyplot as plt from matplotlib import image except ImportError as e : raise ImportError ( 'You must install matplotlib to plot tree' ) from e if ax is None : _ , ax = plt . subplots ( 1 , 1 ) g = to_graphviz ( booster , fmap = fmap , num_trees = num_trees , rankdir = rankdir , * * kwargs ) s = BytesIO ( ) s . write ( g . pipe ( format = 'png' ) ) s . seek ( 0 ) img = image . imread ( s ) ax . imshow ( img ) ax . axis ( 'off' ) return ax