diff --git a/svg.cpp b/svg.cpp index f980ad9..22a61ce 100644 --- a/svg.cpp +++ b/svg.cpp @@ -52,9 +52,9 @@ show_histogram_svg(const vector& bins) { if (k > 1) k = 1; for (size_t bin : bins) { - const double bin_width = BLOCK_WIDTH * bin; - svg_text(TEXT_LEFT, top + TEXT_BASELINE, to_string(bin)); - svg_rect(TEXT_WIDTH, top, bin_width, BIN_HEIGHT, "black", "#87CEEB"); + const double bin_width = BLOCK_WIDTH * bin * k; + svg_text(TEXT_LEFT + top, TEXT_BASELINE, to_string(bin)); + svg_rect(top + 13, 3 * BLOCK_WIDTH, BIN_HEIGHT, bin_width, "black", "#87CEEB"); top += BIN_HEIGHT; } svg_end();