Demo codes for Chart::Gnuplot

Data source

Perl arrays of x coordinates and y coordinates script sample image
Perl array of x-y pairs script sample image
Data file (space delimited) script sample image
Mathematical function script sample image
Parametric function script sample image
Mixed data source script sample image

Basic chart formatting

Add a chart title script sample image
Add axis labels script sample image
Add legend script sample image
Add grid lines script sample image

2D plotting styles

Lines, points and points on lines script sample image
Dots script sample image
Impulses script sample image
Boxes script sample image
Fill the boxes script sample image
Join with steps, fsteps and histeps script sample image
Filled the curves script sample image
Error bar styles script sample image
Error line styles script sample image
Styles of combination of boxes and error bars script sample image
Finance bar style script sample image
Candle stick style script sample image
Horizontal bar style script sample image
Horizontal line style script sample image
Smooth the line segments joining data points script sample image

Line and point styles

Line and point color script sample image
Line type script sample image
Line width script sample image
Point type script sample image
Point size script sample image

Range of the plot

User-specified range of the plot script sample image
Semi-autoscale script sample image
Range of parametric parameter script sample image

Formatting the chart title

Use default settings script sample image
Location script sample image
Font script sample image
Font and font size script sample image
Font color script sample image
Superscript and subscript script sample image
Greek letters script sample image
Composite example script sample image

Formatting the axis label

Use default settings script sample image
Location script sample image
Rotated text script sample image
Font script sample image
Font and font size script sample image
Font color script sample image
Superscript and subscript script sample image
Greek letters script sample image

Formatting the axis tics

Number of minor tics between consecutive major tics script sample image
Specify the tics to label script sample image
Re-label the tics script sample image
Tic label number format script sample image
Tic label font script sample image
Tic label font and font size script sample image
Tic label color script sample image
Location of the tic label script sample image
Rotate the tic label script sample image
Tic length script sample image
Remove the tics on the opposite axis script sample image
Turn on and off the tics script sample image
Composite example script sample image

Formatting the grid lines

Use default settings script sample image
Add minor grid lines script sample image
Line type script sample image
Line width script sample image
Color script sample image
Use another line type for minor grid script sample image
Use another line width for minor grid script sample image
Use another line color for minor grid script sample image
Composite example script sample image

Formatting the legend

Use default settings script sample image
Position script sample image
Add border script sample image
Format the border script sample image
Dimension script sample image
Legend title script sample image
Order of the sample lines script sample image
Alignment of the label script sample image
Format the sample lines script sample image
Composite example script sample image

Formatting the graph borders

Line type script sample image
Line width script sample image
Color script sample image

Date and time data

Date data script sample image
Time data script sample image
Change the date time format of the tic labels script sample image

Plot on the secondary axes

Simple example script sample image
Composite example script sample image

Chart dimension

Orientation script sample image
Image size script sample image
Margin script sample image

Background color

Background color of the chart script sample image
Background color of the plot area script sample image

3D plots

Plot from Perl arrays of x, y and z coordinates script sample image
Plot from Perl array of points script sample image
Plot from data file (space delimited) script sample image
Plot from function script sample image

Multiplot

Use array to define image layout script sample image
Inset graph script sample image
Composite example script sample image