Sometimes matplotlib requires range(len(y))
, e.g., while y=array([1,2,5,6])
, plot(y)
works fine, scatter(y)
does not. One has to write scatter(range(len(y)),y)
. (Personally, I think this is a bug in scatter
; plot
and its friends scatter
and stem
should use the same calling sequences as much as possible.)