-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDetmersReidBoxplot2023.php
More file actions
38 lines (32 loc) · 930 Bytes
/
DetmersReidBoxplot2023.php
File metadata and controls
38 lines (32 loc) · 930 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
namespace Macocci7;
require_once __DIR__ . '/../vendor/autoload.php';
require_once __DIR__ . '/class/CsvUtil.php';
use Macocci7\PhpBoxplot\Boxplot;
use Macocci7\CsvUtil;
$bp = new Boxplot();
$csvUtil = new CsvUtil();
$csvFileName = __DIR__ . '/csv/672282_data.csv';
$dailyData = $csvUtil->getDailyData($csvFileName);
if (!$dailyData) {
echo "Failed to load CSV data.\n\n";
}
$labels = [];
foreach (array_keys($dailyData) as $datestring) {
$labels[] = preg_replace('/^\d+\-(\d+)\-(\d+)$/', '$1/$2', $datestring);
}
$filePath01 = __DIR__ . '/img/BoxplotDetmersReid2023_01.png';
$filePath02 = __DIR__ . '/img/BoxplotDetmersReid2023_02.png';
$bp
->setData($dailyData)
->labels($labels)
->labelX('Game Date')
->labelY('MPH')
->caption('Release Speed: Detmers, Reid')
->meanOn()
->outlierOn()
->jitterOn()
->create($filePath01)
->outlierOff()
->jitterOff()
->create($filePath02);