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

# Create the chart object
my $chart = Chart::Gnuplot->new(
    output  => 'gallery/axisTics_13.png',
    xtics   => {
        labelfmt  => '%.1g',         # label format
        font      => 'arial,18',     # font
        fontcolor => 'magenta',      # text color
    },
    ytics   => {
        labels => [-0.8, 0.3, 0.6],  # specify tic labels
        rotate => '30',              # rotate the text in degree
        mirror => 'off',             # no tic on y2 axis
    },
    x2tics => [-8, -6, -2, 2, 5, 9],
    y2tics => {
        length    => "4,2",          # tic size
        minor     => 4,              # 2 minor tics between major tics
    },
);

# Data set object
my $data = Chart::Gnuplot::DataSet->new(
    func => "sin(x)",
);

# Plot the graph
$chart->plot2d($data);