docs: def do_plot(args):
      """ Create plots of mcmc output """
      import ugali.utils.plotting
      import pylab as plt
  
      config,name,label,coord = args
      filenames = make_filenames(config,label)
      srcfile = filenames['srcfile']
      samfile = filenames['samfile']
      memfile = filenames['memfile']
  
      if not exists(srcfile):
          logger.warning("Couldn't find %s; skipping..."%srcfile)
          return
      if not exists(samfile):
          logger.warning("Couldn't find %s; skipping..."%samfile)
          return
  
      config = ugali.utils.config.Config(config)
      burn = config['mcmc']['nburn']*config['mcmc']['nwalkers']
  
      source = ugali.analysis.source.Source()
      source.load(srcfile,section='source')
  
      outfile = samfile.replace('.npy','.png')
      ugali.utils.plotting.plotTriangle(srcfile,samfile,burn=burn)
      logger.info("  Writing %s..."%outfile)
      plt.savefig(outfile,bbox_inches='tight',dpi=60)
      plt.close()
  
      plotter = ugali.utils.plotting.SourcePlotter(source,config,radius=0.5)
  
      data = fitsio.read(memfile,trim_strings=True) if exists(memfile) else None
      if data is not None:
          plt.figure()
          kernel,isochrone = source.kernel,source.isochrone
          ugali.utils.plotting.plotMembership(config,data,kernel,isochrone)
          outfile = samfile.replace('.npy','_mem.png')
          logger.info("  Writing %s..."%outfile)
          plt.savefig(outfile,bbox_inches='tight',dpi=60)
          plt.close()
              
          plotter.plot6(data)
  
          outfile = samfile.replace('.npy','_6panel.png')
          logger.info("  Writing %s..."%outfile)
          plt.savefig(outfile,bbox_inches='tight',dpi=60)
  
          outfile = samfile.replace('.npy','_6panel.pdf')
          logger.info("  Writing %s..."%outfile)
          plt.savefig(outfile,bbox_inches='tight',dpi=60)
  
          plt.close()
  
      try:
          title = name
          plotter.plot4()
          outfile = samfile.replace('.npy','_4panel.png')
          logger.info("  Writing %s..."%outfile)
          plt.suptitle(title)
          plt.savefig(outfile,bbox_inches='tight',dpi=60)
          plt.close()
      except:
          logger.warning("  Failed to create plotter.plot4()")