code: def print_plot_small(figures_dir, eps_lap, eps_gnmax, answered_gnmax):
      """Plots a graph of LNMax vs GNMax.
  
      Args:
        figures_dir: A name of the directory where to save the plot.
        eps_lap: The cumulative privacy costs of the Laplace mechanism.
        eps_gnmax: The cumulative privacy costs of the Gaussian mechanism
        answered_gnmax: The cumulative count of queries answered.
      """
      xlim = 6000
      x_axis = range(0, int(xlim), 10)
      y_lap = np.zeros(len(x_axis), dtype=float)
      y_gnmax = np.full(len(x_axis), np.nan, dtype=float)
  
      for i in range(len(x_axis)):
          x = x_axis[i]
          y_lap[i] = eps_lap[x]
          idx = np.searchsorted(answered_gnmax, x)
          if idx < len(eps_gnmax):
              y_gnmax[i] = eps_gnmax[idx]
  
      fig, ax = plt.subplots()
      fig.set_figheight(4.5)
      fig.set_figwidth(4.7)
      ax.plot(
          x_axis,
          y_lap,
          color="r",
          ls="--",
          label="LNMax",
          alpha=0.5,
          linewidth=5,
      )
      ax.plot(
          x_axis,
          y_gnmax,
          color="g",
          ls="-",
          label="Confident-GNMax",
          alpha=0.5,
          linewidth=5,
      )
      plt.xticks(np.arange(0, 7000, 1000))
      plt.xlim([0, 6000])
      plt.ylim([0, 6.0])
      plt.xlabel("Number of queries answered", fontsize=16)
      plt.ylabel(
          r"Privacy cost $\varepsilon$ at $\delta=10^{-8}$", fontsize=16
      )
      plt.legend(loc=2, fontsize=13)  # loc=2 -- upper left
      ax.tick_params(labelsize=14)
      fout_name = os.path.join(figures_dir, "lnmax_vs_gnmax.pdf")
      print("Saving the graph to " + fout_name)
      fig.savefig(fout_name, bbox_inches="tight")
      plt.show()
  
file_path: privacy/research/pate_2018/ICLR2018/rdp_cumulative.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import math
  import os
  import pickle
  import sys
  from absl import app
  from absl import flags
  import matplotlib
  import matplotlib.pyplot
  import numpy
  import core
label_desc: Use image node_id 2 for calling a global function with example usage: print_plot_small(figures_dir, eps_lap, eps_gnmax, answered_gnmax) without return types