code: def plothist(x, distfn, args, loc, scale, right=1):
      plt.figure()
      # the histogram of the data
      n, bins, patches = plt.hist(
          x, 25, normed=1, facecolor="green", alpha=0.75
      )
      maxheight = max([p.get_height() for p in patches])
      print(maxheight)
      axlim = list(plt.axis())
      # print(axlim)
      axlim[-1] = maxheight * 1.05
      # plt.axis(tuple(axlim))
      ##    print(bins)
      ##    print('args in plothist', args)
      # add a 'best fit' line
      # yt = stats.norm.pdf( bins, loc=loc, scale=scale)
      yt = distfn.pdf(bins, loc=loc, scale=scale, *args)
      yt[yt > maxheight] = maxheight
      lt = plt.plot(bins, yt, "r--", linewidth=1)
      ys = (
          stats.t.pdf(
              bins,
              10,
              scale=10,
          )
          * right
      )
      ls = plt.plot(bins, ys, "b-", linewidth=1)
  
      plt.xlabel("Smarts")
      plt.ylabel("Probability")
      plt.title(
          r"$\mathrm{{Testing: {} :}}\ \mu={:f},\ \sigma={:f}$".format(
              distfn.name, loc, scale
          )
      )
  
      # plt.axis([bins[0], bins[-1], 0, 0.134+0.05])
  
      plt.grid(True)
      plt.draw()
  
imports: from scipy import stats
  import numpy
  import matplotlib.pyplot
label_desc: Use image node_id 1 for calling a global function with example usage: plothist(x, distfn, args, loc, scale, right) without return types