在下图中,对于每个因子(周),有三个框。但是,我宁愿每周都把盒子放在彼此之上。 (相同的X位置),因此,他们将占用更少的空间。
这是一个玩具数据集,代码是
use strict;
use warnings;
use v5.10;
use DBI;
use Data::UUID;
# Connect to the database.
my $dbh = DBI->connect("dbi:SQLite:dbname=test.db", "", "", { RaiseError => 1});
# Create uuid() which calls Perl to generate a uuid.
$dbh->sqlite_create_function("uuid", 0, sub { Data::UUID->new->create_str });
# Create a table using uuid() as the default.
$dbh->do(q[drop table if exists foo]);
$dbh->do(q[
create table foo (
id int primary key default (uuid()),
name text
)
]);
# Insert some rows using the default id.
$dbh->do(q[
insert into foo (name) values ("you"), ("me")
]);
# Print out the rows.
my $rows = $dbh->selectall_arrayref(q[select * from foo]);
for my $row (@$rows) {
say "$row->[0], $row->[1]";
}