This notebook is just a demo extracted from the synopsis of Devel::IPerl::Plugin::Chart::Plotly
First you need to install Chart::Plotly, so in your shell:
cpanm Chart::Plotly
Just load the plugin:
IPerl->load_plugin('Chart::Plotly');
Once loaded your Chart::Plotly::Plot
and Chart::Plotly::Trace
objects will get displayed automatically
use Chart::Plotly::Trace::Scatter;
my $scatter_trace = Chart::Plotly::Trace::Scatter->new( x => [ 1 .. 5 ], y => [ 1 .. 5 ] );
Also plot objects
use Chart::Plotly::Trace::Box;
use Chart::Plotly::Plot;
my $x = [ 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3 ];
my $box1 = Chart::Plotly::Trace::Box->new( x => $x, y => [ map { rand() } ( 1 .. ( scalar(@$x) ) ) ], name => "box1" );
my $box2 = Chart::Plotly::Trace::Box->new( x => $x, y => [ map { rand() } ( 1 .. ( scalar(@$x) ) ) ], name => "box2" );
my $plot = Chart::Plotly::Plot->new( traces => [ $box1, $box2 ], layout => { boxmode => 'group' } );