diff --git a/python/port/mod/matplotlib/pyplot/plot_view.cpp b/python/port/mod/matplotlib/pyplot/plot_view.cpp index 1c913f0a6..fdb4a9afb 100644 --- a/python/port/mod/matplotlib/pyplot/plot_view.cpp +++ b/python/port/mod/matplotlib/pyplot/plot_view.cpp @@ -57,8 +57,10 @@ void PlotView::traceRect(KDContext * ctx, KDRect r, PlotStore::Rect rect) const KDRect pixelRect( std::round(floatToPixel(Axis::Horizontal, rect.x())), std::round(floatToPixel(Axis::Vertical, rect.y())), - maxKDCoordinate(std::round(rect.width() / pixelWidth()), 1), // Rectangle should at least be visible - std::round(rect.height() / pixelHeight()) + // Use std::ceil instead of std::round to avoid empty pixel line between bars and horizontal axis line + // TODO: change stored rectangles to keep all summits? + maxKDCoordinate(std::ceil(rect.width() / pixelWidth()), 1), // Rectangle should at least be visible + std::ceil(rect.height() / pixelHeight()) ); ctx->fillRect(pixelRect, rect.color()); }