File: multiplot_2.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 (40 lines) | stat: -rwxr-xr-x 980 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
#!/usr/bin/perl -w
use strict;
use Chart::Gnuplot;

#----------------------------------------
# Demonstration of generating inset chart
#----------------------------------------

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

#----------------------------------------
# Large chart
my $large = Chart::Gnuplot->new(
    title  => "Inset chart",
);
my $dataSet = Chart::Gnuplot::DataSet->new(
    func => "norm(x)",
);
$large->add2d($dataSet);
#----------------------------------------

#----------------------------------------
# Small chart
my $small = Chart::Gnuplot->new(
    title  => 'a small chart',
    origin => '0.1, 0.5',
    size   => '0.4, 0.4',
);
$dataSet = Chart::Gnuplot::DataSet->new(
    func => "cos(x)",
);
$small->add2d($dataSet);
#----------------------------------------

#----------------------------------------
# Plot the multplot chart
$multiChart->multiplot($large, $small);
#----------------------------------------