code: def coverage(args):
      
      from jcvi.graphics.base import savefig
  
      p = OptionParser(coverage.__doc__)
      opts, args, iopts = p.set_image_options(args, format="png")
  
      if len(args) != 1:
          sys.exit(not p.print_help())
  
      covfile, = args
      df = pd.read_csv(covfile, sep='\t', names=["Ref", "Position", "Depth"])
  
      xlabel, ylabel = "Position", "Depth"
      df.plot(xlabel, ylabel, color='g')
  
      image_name = covfile + "." + iopts.format
      savefig(image_name)
docs: %prog coverage *.coverage
  
      Plot coverage along chromosome. The coverage file can be generated with:
      $ samtools depth a.bam > a.coverage
  
      The plot is a simple line plot using matplotlib.