NAME

PDL::Graphics - Introduction to the PDL::Graphics modules

DESCRIPTION

PDL has full-featured plotting abilities. Unlike MATLAB, PDL relies more on third-party libraries for its plotting features: Prima, Gnuplot, OpenGL, PLplot and PGplot. PDL has several plotting modules that you can choose from, each of them with their particular strength and weaknesses. In this page, you will find a short review of each of the main PDL::Graphics::* modules.

GRAPHIC MODULES REVIEWS

The newest generation of PDL::Graphics modules

PDL::Graphics::Simple

Best for: backend-independent output: you get the same plots, whichever of the graphical module you manage to install.

A unified backend-independent plotting interface for PDL. It implements all the functionality used in the PDL::Book examples, and it will probably be the easiest PDL::Graphics module for you to install, as it relies on any of the other ones. Because it is backend-independent, the plot you get will always be what you asked for, regardless of which plotting engine you have installed on your system.

Only a subset of PDL's complete graphics functionality is supported -- each individual plotting module has unique advantages and functionality that are beyond what PDL::Graphics::Simple can do.

PDL::Graphics::Gnuplot

Best for: publication-quality 2D and 3D plots

Gnuplot is widely used and produces publication-quality plots. It is also interactive: you can pan, scale, and rotate both 2-D and 3-D plots. And its API is powerful, simple and intuitive.

A video tutorial is available.

Notice: you must install gnuplot on your computer first.

PDL::Graphics::Prima

Best for: Integration of your plots into your application GUI. Possibility to create a dedicated GUI to let your application users interact with the plotted data.

Lets you focus on what you want to visualize rather than the details of how you would draw it. Its killer feature is that it belongs to the the Prima GUI environment (an alternative to Tk, Gtk, Wx, etc). Prima provides an array of useful interactive widgets and a simple but powerful event-based programming model. These tools allow you to build interactive data visualization and analysis applications with sophisticated plotting and intuitive user interaction in only a few hundred lines of code. Or more simply, to include a plot into an application.

For this reason, PDL::Graphics::Prima's API is more complex than PDL::Graphics::Gnuplot's. It is advised to start with PDL::Graphics::Prima::Simple, which focuses on the plotting functions and does not mess with Widgets. A tutorial is available here: http://search.cpan.org/~chm/PDL-2.006/Demos/Prima.pm As well as a video tutorial.

PDL::Graphics::TriD

Best for: Plotting heavy 3D images, fast.

The native PDL 3D graphics library using OpenGL as a backend for 3D plots and data visualization. With OpenGL, it is easy to manipulate the resulting 3D objects with the mouse in real time.

OpenGL makes PDL::Graphics::TriD a lot faster than Gnuplot to manipulate 3D images. But Gnuplot's output is publication quality, and Gnuplot is in general easier to manipulate. If you manipulate heavy images, PDL::Graphics::TriD might be the thing for you.

Good old PDL::Graphics modules

Still well maintained, documented, and widely used.

PDL::Graphics::PLplot

Best for: Plotting 2D functions as well as 2D and 3D data sets.

This is an interface to the PLplot plotting library. PLplot is a modern, open source library for making scientific plots. It supports plots of both 2D and 3D data sets. PLplot is best supported for unix/linux/macosx platforms. It has an active developers community and support for win32 platforms is improving.

PDL::Graphics::PGPLOT

Best for: Plotting 2D functions. More widely used in the scientific community

This is an interface to the venerable PGPLOT library. PGPLOT has been widely used in the academic and scientific communities for many years. In part because of its age, PGPLOT has some limitations compared to newer packages such as PLplot (e.g. no RGB graphics). But it has many features that still make it popular in the scientific community.

AUTHOR

Pierre Masci, 2013