input: Write a python function to count the occurrences of each letter in a list of words and plot the results using a bar chart.
  assert count_and_plot_occurrences(['apple', 'banana', 'cherry']) == {'a': 5, 'b': 1, 'c': 1, 'd': 0, 'e': 2, 'f': 0, 'g': 0, 'h': 1, 'i': 0, 'j': 0, 'k': 0, 'l': 1, 'm': 0, 'n': 2, 'o': 0, 'p': 2, 'q': 0, 'r': 1, 's': 0, 't': 0, 'u': 0, 'v': 0, 'w': 0, 'x': 0, 'y': 1, 'z': 0}
  assert count_and_plot_occurrences(['dog', 'cat', 'elephant']) == {'a': 2, 'b': 0, 'c': 1, 'd': 1, 'e': 2, 'f': 0, 'g': 1, 'h': 1, 'i': 0, 'j': 0, 'k': 0, 'l': 1, 'm': 0, 'n': 1, 'o': 1, 'p': 1, 'q': 0, 'r': 0, 's': 0, 't': 2, 'u': 0, 'v': 0, 'w': 0, 'x': 0, 'y': 0, 'z': 0}
  assert count_and_plot_occurrences(['hello', 'world']) == {'a': 0, 'b': 0, 'c': 0, 'd': 1, 'e': 1, 'f': 0, 'g': 0, 'h': 1, 'i': 0, 'j': 0, 'k': 0, 'l': 3, 'm': 0, 'n': 0, 'o': 2, 'p': 0, 'q': 0, 'r': 1, 's': 0, 't': 0, 'u': 0, 'v': 0, 'w': 1, 'x': 0, 'y': 0, 'z': 0}
output: def count_and_plot_occurrences(words):
      from collections import Counter
      import string
      import matplotlib.pyplot as plt
  
      # Flatten the list of words into a single string and count occurrences of each letter
      letter_counts = Counter(''.join(words).lower())
  
      # Ensure all letters in the alphabet are in the dictionary
      all_letters = string.ascii_lowercase
      occurrences = {letter: letter_counts.get(letter, 0) for letter in all_letters}
      
      # Plotting the results using a bar chart
      plt.bar(occurrences.keys(), occurrences.values())
      plt.xlabel('Letters')
      plt.ylabel('Occurrences')
      plt.title('Letter Occurrences in Given Words')
      plt.show()
      
      return occurrences