DOC: introduce variable num_peaks for reusability

Hi,

A fix to facilitate the modification of the number of peaks in the example.