Git Product home page Git Product logo

perl5-chart-ggplot's Introduction

Actions Status

NAME

Chart::GGPlot - ggplot2 port in Perl

VERSION

version 0.002003

STATUS

At this moment this library is experimental and still under active development (at my after-work time). It's still quite incomplete compared to R's ggplot2 library, but the core features are working.

SYNOPSIS

use Chart::GGPlot qw(:all);
use Data::Frame::Examples qw(mtcars);

my $plot = ggplot(
    data => mtcars(),
    mapping => aes( x => 'wt', y => 'mpg' )
)->geom_point();

# show in browser
$plot->show;

# export to image file
$plot->save('mtcars.png');

# see "examples" dir of this library's distribution for more examples.

DESCRIPTION

This Chart-GGPlot library is an implementation of ggplot2 in Perl. It's designed to be possible to support multiple plotting backends. And it ships a default backend which uses Chart::Plotly.

This Chart::GGPlot module is the function interface of the Perl Chart-GGPlot library.

Example exported image files:

proportional stacked bar line chart boxplot smooth viridis color scale polygon heatmap text bar theme 'minimal'

See the examples dir in the library's distribution for more examples.

Document Conventions

Function signatures in docs of this library follow the Function::Parameters conventions, for example,

myfunc(Type1 $positional_parameter, Type2 :$named_parameter)

FUNCTIONS

ggplot

ggplot(:$data, :$mapping, %rest)

This is same as Chart::GGPlot::Plot->new(...). See Chart::GGPlot::Plot for details.

qplot

qplot((Piddle1D|ArrayRef) :$x, (Piddle1D|ArrayRef) :$y,
    Str :$geom='auto',
    :$xlim=undef, :$ylim=undef,
    Str :$log='',
    Maybe[Str] :$title=undef, Str :$xlab='x', Str :$ylab='y',
    %rest)

Arguments:

  • $x, $y

    Data. Supports either 1D piddles or arrayrefs. When arrayref is specified, it would be converted to either a numeric piddle or a PDL::SV piddle, guessing by its contents.

  • $geom

    Geom type. "auto" is treated as 'point'. It would internally call a geom_${geom} function.

  • $xlim, $ylim

    Axes limits.

  • $log

    Which axis use logarithmic scale? One of '', 'x', 'y', 'xy'.

  • $title

    Plot title. Default is undef, for no title.

  • $xlabel, $ylabel

    Axes labels.

ENVIRONMENT VARIABLES

CHART_GGPLOT_TRACE

A positive integer would enable debug messages.

SEE ALSO

ggplot2

Chart::GGPlot::Plot

Data::Frame

AUTHOR

Stephan Loyd [email protected]

CONTRIBUTOR

Pablo Rodríguez (pablrod)

COPYRIGHT AND LICENSE

This software is copyright (c) 2019-2023 by Stephan Loyd.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.