diff --git a/python/port/mod/matplotlib/pyplot/modpyplot.cpp b/python/port/mod/matplotlib/pyplot/modpyplot.cpp index 0cc1005d6..c2b08b36a 100644 --- a/python/port/mod/matplotlib/pyplot/modpyplot.cpp +++ b/python/port/mod/matplotlib/pyplot/modpyplot.cpp @@ -251,23 +251,25 @@ mp_obj_t modpyplot_hist(size_t n_args, const mp_obj_t *args) { // Initialize bins list mp_obj_t * binItems = m_new(mp_obj_t, nBins); for (size_t i=0; i= lowerBound); + // Increment the bin count + binItems[binIndex] = MP_OBJ_NEW_SMALL_INT(MP_OBJ_SMALL_INT_VALUE(binItems[binIndex]) + 1); xIndex++; - if (xIndex == xLength) { - break; - } } binIndex++; }