matplotlib does not support generators as input code example
Example: matplotlib does not support generators as input
list or tuple should be appropriate input for matplotlib.
A fixed length generator can always be converted to a list.
vals_list = list(vals_generator)