From 803a960145febc29b7b798232dd70951b2fd944a Mon Sep 17 00:00:00 2001 From: Tanya Date: Sun, 5 May 2024 21:55:38 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=B5=D1=80=D0=B5=D0=B4=D0=B5=D0=BB?= =?UTF-8?q?=D0=B0=D0=BD=D0=B0=20=D1=84=D1=83=D0=BD=D0=BA=D1=86=D0=B8=D1=8F?= =?UTF-8?q?=20=D0=B2=D1=8B=D0=B2=D0=BE=D0=B4=D0=B0=20=D0=B3=D0=B8=D1=81?= =?UTF-8?q?=D1=82=D0=BE=D0=B3=D1=80=D0=B0=D0=BC=D0=BC=D1=8B=20=D0=BF=D0=BE?= =?UTF-8?q?=D0=B4=20=D0=B8=D0=BD=D0=B4=D0=B8=D0=B2=D0=B8=D0=B4=D1=83=D0=B0?= =?UTF-8?q?=D0=BB=D1=8C=D0=BD=D1=8B=D0=B9=20=D0=B2=D0=B0=D1=80=D0=B8=D0=B0?= =?UTF-8?q?=D0=BD=D1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- svg.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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();