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

# Initiate the chart object
my $chart = Chart::Gnuplot->new(
    output  => 'gallery/plotAxes_2.png',
    xrange  => [-1, 1],
    x2range => ['-pi', 'pi'],
    xtics   => {
        mirror => 'off',
    },
    ytics   => {
        mirror => 'off',
    },
    x2tics  => 'on',
    y2tics  => 'on',
);

# Data sets
my $cos = Chart::Gnuplot::DataSet->new(
    func  => "cos(x)",
    style => "lines",
);
my $sin = Chart::Gnuplot::DataSet->new(
    func  => "sin(x)*2",
    style => "lines",
    axes  => 'x2y2',
);

# Plot the graph
$chart->plot2d($cos, $sin);