I have some Python code (running on Python3) for Matplotlib that boils down to the following:
title = 'A title'
fig, ax = plt.subplots()
x_values = []
y_values = []
# x_values and y_values are populated by extracting values from a dict I pass in.
# The values are extracted correctly; I printed them out for a sanity check.
plt.plot(x_values, y_values)
ax.set_xlim([0, 100])
plt.ylabel('Y')
plt.xlabel('X')
plt.title(title, fontsize=title_size)
fig.autofmt_xdate()
plt.show()
The following shows what is in x_values and y_values for a particular dict (it so happens all the y values are the same for this particular dataset):

The following is the graphical output:

Note that not only is the graph shape is unexpected, but the y-axis scale is incredibly off as well.
I cannot fathom why this is happening. For other datasets with more variation, I get better graphs where the plotted values match my raw values. For example:

Is there some oddity of plot() I am unaware of? Or am I using a bad sequence or combination of code? Otherwise, what could cause this?