DOCUMENT();

loadMacros(
    'PGstandard.pl',       'PGML.pl',
    'StatisticalPlots.pl', 'PGstatisticsmacros.pl',
    'PGcourse.pl'
);

#


@data = urand(100, 25, 75, 6);

$boxplotA = StatPlot(
    xmin            =>  0,
    xmax            => 200,
    xtick_delta     =>  25,
    show_grid       =>  0,
    ymin            => -5,
    ymax            =>  25,
    yvisible        =>  0,
    aspect_ratio    =>  4,
    rounded_corners => 1
);

$boxplotA->add_boxplot(~~@data, fill_color => 'lightblue', stroke_width => 1);

# the five point summary is needed for the alt text:

@five_point = five_point_summary(@data);
$minA       = Round($five_point[0]);
$q1A        = Round($five_point[1]);
$medA       = Round($five_point[2]);
$q3A        = Round($five_point[3]);
$maxA       = Round($five_point[4]);

$alt_textA =
    "A horizontal box plot with the box between $q1A and $q3A and vertical "
    . "line at $medA. The is line from the box to the left from $q1A to $minA and a "
    . "line to the right from $q3A to $maxA.";

# Alternatively, we can set these value for the plot.

$boxplotB = StatPlot(
    xmin            => 100,
    xmax            => 400,
    ymin            => -5,
    ymax            =>  25,
    xtick_delta     =>  50,
    yvisible        =>  0,
    show_grid       =>  0,
    aspect_ratio    =>  4,
    rounded_corners => 1
);

$minB = random(150, 175, 5);
$q1B  = random(180, 225, 5);
$medB = random(250, 275, 5);
$q3B  = random(280, 320, 10);
$maxB = random(325, 350, 5);

$boxplotB->add_boxplot({
    min      => $minB,
    q1       => $q1B,
    median   => $medB,
    q3       => $q3B,
    max      => $maxB,
    outliers => [ 115, 130, 375 ]
});

$alt_textB =
    "A horizontal box plot with the box between $q1B and $q3B and vertical "
    . "line at $medA. The is line from the box to the left from $q1B to $minB and a "
    . "line to the right from $q3B to $maxB.  There are also 3 small plus signs at "
    . "115, 130 and 375.";

BEGIN_PGML

>>[! [$alt_textA] !]{$boxplotA}{400}<<

>>[! [$alt_textB] !]{$boxplotB}{400}<<


END_PGML

BEGIN_PGML_SOLUTION
Add solution here.
END_PGML_SOLUTION

ENDDOCUMENT();