code: def check_valid_format(figformat):
      
      fig = plt.figure()
      if figformat in list(fig.canvas.get_supported_filetypes().keys()):
          logging.info("Nanoplotter: valid output format {}".format(figformat))
          return figformat
      else:
          logging.info("Nanoplotter: invalid output format {}".format(figformat))
          sys.stderr.write("Invalid format {}, using default.\n".format(figformat))
          return "png"
docs: Check if the specified figure format is valid.
  
      If format is invalid the default is returned.
      Probably installation-dependent