项目作者: stphnlyd

项目描述 :
Perl中的ggplot端口
高级语言: Perl
项目地址: git://github.com/stphnlyd/perl5-Chart-GGPlot.git
创建时间: 2018-12-09T10:31:44Z
项目社区:https://github.com/stphnlyd/perl5-Chart-GGPlot

开源协议:

下载


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

  1. use Chart::GGPlot qw(:all);
  2. use Data::Frame::Examples qw(mtcars);
  3. my $plot = ggplot(
  4. data => mtcars(),
  5. mapping => aes( x => 'wt', y => 'mpg' )
  6. )->geom_point();
  7. # show in browser
  8. $plot->show;
  9. # export to image file
  10. $plot->save('mtcars.png');
  11. # 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,

  1. myfunc(Type1 $positional_parameter, Type2 :$named_parameter)

FUNCTIONS

ggplot

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

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

qplot

  1. qplot((Piddle1D|ArrayRef) :$x, (Piddle1D|ArrayRef) :$y,
  2. Str :$geom='auto',
  3. :$xlim=undef, :$ylim=undef,
  4. Str :$log='',
  5. Maybe[Str] :$title=undef, Str :$xlab='x', Str :$ylab='y',
  6. %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 sloyd@cpan.org

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.