


I find them most useful particularly for publication-quality scatter diagrams. While the PNG driver in Gnuplot doesn’t generate terribly good-looking output, both the Postscript and SVG drivers work very well. Now in some ways, the Gnuplot language syntax seems somewhat old-fashioned, but once you learn it (or better yet, learn to write programs that generate it). One can generate publication-quality graphs with Excel, but it is a chore, and most importantly, one cannot easily set the exact sizes of diagrams or generate high resolution images of graphs.

(Full disclosure: I am mainly speaking of the base plotting library–I have not extensively used some of the other libraries such as lattice or ggplot2). The R suite is much better suited for statistical analysis, but the plot generation capabilities aren’t as flexible and to my eye don’t look as good. E.g.After careful consideration of the alternatives on different platforms, I’ve concluded the best software for generating publication-quality plots is Gnuplot. Properties of the chart title can be specified in hash. If the filename has no extension, postscipt format will be output. Jpg : Joint Photographic Experts Group JFIF format Some of image formats that can be detected automatically are: bmp : Microsoft Windows bitmapĮpdf : Encapsulated Portable Document FormatĮpi : Encapsulated PostScript Interchange format However, it can also be changed manually by the terminal option or the format conversion methods such as convert and png. (Please refer to "MECHANISM OF THIS MODULE" for details). output => "fig/chart.png",īy default, the image format is detected automatically by the extension of the filename. Properties of the chart may be specified optionally when the object is initiated: my $chart = Chart::Gnuplot->new(%options) Chart Options output The chart object can be initiated by the c method. mousing supported SVG, which ImageMagick cannot be converted to, the terminal must be set explicitly (e.g., svg mousing in this case). On the other hand, for some image formats, e.g. The rationale of this approach is that the postscript terminal is so far the best developed teriminal and so this would let users to enjoy the power of Gnuplot as much as possible.īecause the default terminal is postscript, if ImageMagick is not installed, you would always need to specify the terminal if the output format is not PS (or EPS). Unless specified explicitly in terminal of the Chart object, Chart::Gnuplot would by default generate the image in PS format first and then convert the image (by ImageMagick) based on the extension of the filename. plot2d) is called, Chart::Gnuplot would generate a Gnuplot script based on the information in the chart object and dataset object. A lot of examples can be found in SourceForge. To illustate the features of Chart::Gnuplot, the best way is to show by examples. Dataset object contains information about the dataset to be plotted, including source of the data points, dataset label, color used to plot and more.Īfter chart object and dataset object(s) are created, the chart can be plotted using the plot2d, plot3d or multiplot method of the chart object, e.g. Information about the chart such as output file, chart title, axes labels and so on is specified in the chart object.

To plot chart using Chart::Gnuplot, a chart object and at least one dataset object are required. Please refer to "MECHANISM OF THIS MODULE" for details. If image format other than PS and EPS is required to generate, it is recommended to install the convert program of ImageMagick as well. In order to use this module, gnuplot need to be installed. This Perl module is to plot graphs uning GNUPLOT on the fly. Xdata => => => "Plotting a line from Perl arrays", My $dataSet = Chart::Gnuplot::DataSet->new( # Create dataset object and specify the properties of the dataset # Create chart object and specify the properties of the chart Chart::Gnuplot - Plot graph using Gnuplot in Perl on the fly SYNOPSIS use Chart::Gnuplot
