File: multiplot_3.pl

package info (click to toggle)
libchart-gnuplot-perl 0.23-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 944 kB
  • sloc: perl: 4,862; makefile: 113
file content (50 lines) | stat: -rwxr-xr-x 1,226 bytes parent folder | download | duplicates (6)
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
39
40
41
42
43
44
45
46
47
48
49
50
#!/usr/bin/perl -w
use strict;
use Chart::Gnuplot;

my $multiChart = Chart::Gnuplot->new(
    output => "gallery/multiplot_3.png",
    title  => "Multiplot chart",
);

#----------------------------------------
# Left chart
my @charts = ();
$charts[0][0] = Chart::Gnuplot->new(
    grid => "on",
);
my $dataSet = Chart::Gnuplot::DataSet->new(
    func => "(x*x+y*y) * exp(-0.05*(x*x+y*y))",
);
$charts[0][0]->add3d($dataSet);
#----------------------------------------

#----------------------------------------
# Central chart
my @y = (5, 2.3, 6.78, 1, 0, 4.4, 7, 2.7, 5.4, 7.8, 9.5);
$charts[0][1] = Chart::Gnuplot->new();
$dataSet = Chart::Gnuplot::DataSet->new(
    ydata => \@y,
    style => "boxes",
);
$charts[0][1]->add2d($dataSet);
#----------------------------------------

#----------------------------------------
# Right chart
$charts[0][2] = Chart::Gnuplot->new(
    title => {
        text  => "Right chart",
        color => "#99ccff",
    }
);
$dataSet = Chart::Gnuplot::DataSet->new(
    func      => "cos(x)",
    style     => "linespoints",
    pointtype => "triangle",
);
$charts[0][2]->add2d($dataSet);
#----------------------------------------

# Plot the multplot chart
$multiChart->multiplot(\@charts);