IRIS Toolbox Reference Manual

graph

Add graph to figure

Syntax

P.graph(Cap,...)

Input arguments

Options

Date format options

See dat2str for details on date format options.

Generic options

See help on generic options in report objects.

Description

The options 'preProcess=' and 'postProcess=' give you additional flexibility in customising the graphics style of the axes object. The values assigned to these options are expected to be strings with an executable Matlab command, or commands separated with semi-colons (as if typed on one line in the command window). The command can refer to the following variables:

Example

Create a one-page report with a chart in on the LHS and the legend moved to the RHS. Use the function grfun.movetosubplot in the option 'postProcess=', referring to L (handle to the legend object associated with the respective axes object) to move the legend around.

% Create random data series.
A = tseries(1:10,@rand);
B = tseries(1:10,@rand);

% Open a new report.
x = report.new();

% Open a new figure in the report with a 1-by-2 layout.
x.figure('My Figure','subplot=',[1,2]);

    % The graph will be placed in the LHS space.
    % Use `grfun.movetosubplot` to move the legend to the RHS space.
    x.graph('My Graph','legend=',true, ...
        'postProcess=','grfun.movetosubplot(L,1,2,2)');

        x.series('Series A',A);
        x.series('Series B',B);

x.publish('test.pdf');
open test.pdf;