Lab::Moose::DataFile::Gnuplot::2D - 2D data file with live plotting support
version 3.600
use Lab::Moose; my $folder = datafolder(); my $file = datafile( type => 'Gnuplot::2D', folder => $folder, filename => 'gnuplot-file.dat', columns => [qw/time voltage temp/] ); $file->add_plot( x => 'time', y => 'voltage', curve_options => {with => 'points'}, hard_copy => 'gnuplot-file-T-V.png', ); $file->add_plot( x => 'time', y => 'temp', hard_copy => 'gnuplot-file-T-Temp.png', ); $file->log(time => 1, voltage => 2, temp => 3);
This submodule of Lab::Moose::DataFile::Gnuplot provides live plotting of 2D data with gnuplot. It requires PDL::Graphics::Gnuplot installed.
This module inherits all methods of Lab::Moose::DataFile::Gnuplot.
$file->add_plot( x => 'x-column', y => 'y-column', plot_options => {grid => 1, xlabel => 'voltage', ylabel => 'current'}, curve_options => {with => 'points'}, hard_copy => 'myplot.png', hard_copy_terminal => 'svg', );
Add a new live plot to the datafile. Options:
x (mandatory)
Name of the column which is used for the x-axis.
y (mandatory)
Name of the column which is used for the y-axis.
terminal
gnuplot terminal. Default is qt.
terminal_options
HashRef of terminal options. For the qt and x11 terminals, this defaults to {persist => 1, raise => 0}.
{persist => 1, raise => 0}
plot_options
HashRef of plotting options (See PDL::Graphics::Gnuplot for the complete list).
curve_options
HashRef of curve options (See PDL::Graphics::Gnuplot for the complete list).
handle
Set this to a string, if you need to refresh the plot manually with the refresh_plots option. Multiple plots can share the same handle string.
refresh_plots
hard_copy
Create a copy of the plot in the data folder.
hard_copy_terminal
Terminal for hard_copy option. Use png terminal by default. The 'output' terminal option must be supported.
$file->refresh_plots(handle => $handle); $file->refresh_plots();
Call refresh_plot for each plot with hanle $handle.
refresh_plot
$handle
If the handle argument is not given, refresh all plots.
This software is copyright (c) 2017 by the Lab::Measurement team; in detail:
Copyright 2016 Simon Reinhardt 2017 Andreas K. Huettel, Simon Reinhardt
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Lab::Measurement, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Lab::Measurement
CPAN shell
perl -MCPAN -e shell install Lab::Measurement
For more information on module installation, please visit the detailed CPAN module installation guide.