code: def _plot_estimate(
      cls,
      estimate=None,  # string like "survival_function_", "cumulative_density_", "hazard_", "cumulative_hazard_"
      loc=None,
      iloc=None,
      show_censors=False,
      censor_styles=None,
      ci_legend=False,
      ci_force_lines=False,
      ci_only_lines=False,
      ci_no_lines=False,
      ci_alpha=0.25,
      ci_show=True,
      at_risk_counts=False,
      logx: bool = False,
      ax=None,
      **kwargs,
  ):
      """
      Plots a pretty figure of estimates
  
      Matplotlib plot arguments can be passed in inside the kwargs, plus
  
      Parameters
      -----------
      show_censors: bool
          place markers at censorship events. Default: False
      censor_styles: bool
          If show_censors, this dictionary will be passed into the plot call.
      ci_show: bool
          show confidence intervals. Default: True
      ci_alpha: bool
          the transparency level of the confidence interval. Default: 0.3
      ci_force_lines: bool
          make the confidence intervals to be line plots (versus default shaded areas + lines). Default: False
          Deprecated: use ``ci_only_lines`` instead.
      ci_only_lines: bool
          make the confidence intervals to be line plots (versus default shaded areas + lines). Default: False.
      ci_no_lines: bool
          Only show the shaded area, with no boarding lines. Default: False
      ci_legend: bool
          if ci_force_lines is True, this is a boolean flag to add the lines' labels to the legend. Default: False
      at_risk_counts: bool
          show group sizes at time points. See function ``add_at_risk_counts`` for details. Default: False
      loc: slice
          specify a time-based subsection of the curves to plot, ex:
  
          >>> model.plot(loc=slice(0.,10.))
  
          will plot the time values between t=0. and t=10.
      iloc: slice
          specify a location-based subsection of the curves to plot, ex:
  
          >>> model.plot(iloc=slice(0,10))
  
          will plot the first 10 time points.
      logx: bool
          Use log scaling on x axis
  
  
      Returns
      -------
      ax:
          a pyplot axis object
      """
      from matplotlib import pyplot as plt
  
      if ci_force_lines:
          warnings.warn(
              "ci_force_lines is deprecated. Use ci_only_lines instead (no functional difference, only a name change).",
              DeprecationWarning,
          )
          ci_only_lines = ci_force_lines
      if "point_in_time" in kwargs:  # marker for given point
          point_in_time = kwargs["point_in_time"]
          kwargs.pop("point_in_time")
      plot_estimate_config = PlotEstimateConfig(
          cls,
          estimate,
          loc,
          iloc,
          show_censors,
          censor_styles,
          logx,
          ax,
          **kwargs,
      )
  
      dataframe_slicer = create_dataframe_slicer(
          iloc, loc, cls.timeline
      )
  
      if show_censors and cls.event_table["censored"].sum() > 0:
          cs = {"marker": "+", "ms": 12, "mew": 1}
          cs.update(plot_estimate_config.censor_styles)
          censored_times = dataframe_slicer(
              cls.event_table.loc[(cls.event_table["censored"] > 0)]
          ).index.values.astype(float)
          v = plot_estimate_config.predict_at_times(
              censored_times
          ).values
          plot_estimate_config.ax.plot(
              censored_times,
              v,
              linestyle="None",
              color=plot_estimate_config.colour,
              **cs,
          )
      dataframe_slicer(plot_estimate_config.estimate_).rename(
          columns=lambda _: plot_estimate_config.kwargs.pop("label")
      ).plot(
          logx=plot_estimate_config.logx, **plot_estimate_config.kwargs
      )
  
      # plot confidence intervals
      if ci_show:
          if ci_only_lines:
              # see https://github.com/CamDavidsonPilon/lifelines/issues/928
              with warnings.catch_warnings():
                  warnings.simplefilter("ignore")
                  (
                      dataframe_slicer(
                          plot_estimate_config.confidence_interval_
                      )
                      .rename(
                          columns=lambda s: ("" if ci_legend else "_")
                          + s
                      )
                      .plot(
                          linestyle="-",
                          linewidth=1,
                          color=[plot_estimate_config.colour],
                          drawstyle=plot_estimate_config.kwargs[
                              "drawstyle"
                          ],
                          alpha=0.6,
                          logx=plot_estimate_config.logx,
                          ax=plot_estimate_config.ax,
                      )
                  )
          else:
              x = dataframe_slicer(
                  plot_estimate_config.confidence_interval_
              ).index.values.astype(float)
              lower = dataframe_slicer(
                  plot_estimate_config.confidence_interval_.iloc[:, [0]]
              ).values[:, 0]
              upper = dataframe_slicer(
                  plot_estimate_config.confidence_interval_.iloc[:, [1]]
              ).values[:, 0]
  
              if plot_estimate_config.kwargs["drawstyle"] == "default":
                  step = None
              elif plot_estimate_config.kwargs["drawstyle"].startswith(
                  "step"
              ):
                  step = plot_estimate_config.kwargs[
                      "drawstyle"
                  ].replace("steps-", "")
              plot_estimate_config.ax.fill_between(
                  x,
                  lower,
                  upper,
                  alpha=ci_alpha,
                  color=plot_estimate_config.colour,
                  linewidth=0.0 if ci_no_lines else 1.0,
                  step=step,
              )
      if at_risk_counts:
          add_at_risk_counts(cls, ax=plot_estimate_config.ax)
          plt.tight_layout()
      if "point_in_time" in locals():
          plot_estimate_config.ax.scatter(
              point_in_time,
              cls.survival_function_at_times(point_in_time),
          )
      return plot_estimate_config.ax
  
imports: import warnings
  from typing import Union, Optional, Iterable
  from scipy import stats
  import pandas
  import numpy
  from lifelines.utils import coalesce, CensoringType, _group_event_table_by_intervals
label_desc: Use image node_id 19 for calling a global function with example usage: _plot_estimate(cls, estimate, loc, iloc, show_censors, censor_styles, ci_legend, ci_force_lines, ci_only_lines, ci_no_lines, ci_alpha, ci_show, at_risk_counts, logx, ax) and returns: plot_estimate_config