PDL-Graphics-Prima

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN


  - Added pt::NGons, renamed to pt::Symbols; added lots of derived plot types;
    added pt::TrendLines.
  
  - Simple API now includes plot, line_plot, circle plot, triangle_plot,
    square_plot, diamond_plot, cross_plot, X_plot, asterisk_plot, hist_plot,
    matrix_plot, and func_plot.
  
  - Right-click menu added.
  
  - Postscript and clipboard output added.



0.00_05 2011-10-25

  - Windows is now preliminarily supported.
  
  - DataSets are now plotted in asciibetical order, by name.


lib/PDL/Graphics/Prima.pm  view on Meta::CPAN

		# Other important and basic settings
		selectable => 1,
		buffered => 1,

		popupItems => default_popup_items(),
	};
}

sub default_popup_items
{[
	['~Copy'           => 'copy_to_clipboard'     ],
	['P~rint'          => 'print'                 ],
	['~Export to'      => [
		[ '~Image'         => 'save_to_image' ],
		[ '~Postscript'    => 'save_to_ps'    ],
		[ '~EPS'           => 'save_to_eps'   ],
		[ 'P~DF'           => 'save_to_pdf'   ],
	]],
	['~Autoscale'      => 'autoscale'             ],
	['~Properties'     => 'set_properties_dialog' ]
]}

lib/PDL/Graphics/Prima.pm  view on Meta::CPAN

			if (defined $::application) {
				Prima::MsgBox::message($message, mb::Ok);
				carp($message);
			}
			else {
				croak($message);
			}
		};
}

sub copy_to_clipboard {
	my $self = shift;
	my $image = $self->get_image;
	
	my $clipboard = $::application->Clipboard;
	$clipboard->open;
	$clipboard->clear;
	$clipboard->image($image);
	$clipboard->close;
}

sub print
{
	my $self = shift;

	my $print_dialog = Prima::Dialog::PrintDialog-> new;
	unless ($print_dialog-> execute) {
		$print_dialog->destroy;
		return;

lib/PDL/Graphics/Prima.pm  view on Meta::CPAN

This functionality will likely be merged into save_to_file, though this
method will remain for backwards compatibility.

=head2 save_to_file

Saves the plot to a raster image file. This method
takes an optional filename argument, deducing the format (and applicable
codec) from the filename. If no filename is specified, it creates a dialog
box asking the user where and under what name they want to save the file.

=head2 copy_to_clipboard

Copies the plot with current axis limits as a bitmap image to the clipboard.
The resulting clipboard entry is suitable for pasting into applications that
know how to handle bitmap images such as LibreOffice or gpaint on Linux,
Microsoft Office or Windows Paint on Windows.

=head1 Events

You can send notifications and hook callbacks for the following events:

=head2 ChangeTitle

Called when the title or titleSpace gets changed

lib/PDL/Graphics/Prima/Internals.pod  view on Meta::CPAN

      |- type-specific data
      |- $self->xmin($dataset, $widget)
      |- $self->xmax($dataset, $widget)
      |- $self->ymin($dataset, $widget)
      |- $self->ymax($dataset, $widget)
      |- $self->draw($dataset, $widget)
    |- $self->get_data_as_pixels($widget)
    |- $self->extremum($nane, $comperator, $widget)
  |- $self->compute_min_max_for($axis_name)
  |- $self->get_image
  |- $self->copy_to_clipboard
  |- $self->save_to_file



=for details
XXX working here
XXX see also: Axis.pm recompute_max_auto, recompute_min_auto

=for motivation
The major issue with determining automatic scaling is that I consider two

lib/PDL/Graphics/Prima/Simple.pm  view on Meta::CPAN


=item dragging/panning

Once you have zoomed into a region, you can examine nearby data by clicking and
dragging with your left mouse button, much like an interactive map.

=item context menu

Right-clicking on the plot will bring up a L<context menu|Prima::Menu> with
options including restoring auto-scaling, L<copying the current plot image to
your clipboard|PDL::Graphics::Prima/copy_to_clipboard>* (to paste directly
into, say, Microsoft's PowerPoint or LibreOffice's Impress),
and saving the current plot image to a
L<postscript|PDL::Graphics::Prima/save_to_postscript> or
L<raster|PDL::Graphics::Prima/save_to_file> file. Postscript
output is L<always|Prima::PS::Drawable> L<supported|Prima::PS::Printer>, but
the supported raster output file formats depend on the L<image libraries and
codecs that Prima was able to build against|Prima::image-load>, so are system-
and machine-dependent. For additional information on raster images, see
L<Prima::Image>.

* For reasons not clear to me, copying the plot to the clipboard does not
seem to work on Mac and appear to be due to limitations with the X-window
bindings.

=item resizable

When packed into a resizable window (as is the case in this example), the plot
can be resized and it will be updated and redrawn smoothly.

=back



( run in 2.391 seconds using v1.01-cache-2.11-cpan-84e82930d8c )