<< mat2latex Printings and graphs ndigits >>

Grocer >> Printings and graphs > mpltseries

mpltseries

multiple 2d plot in one page

CALLING SEQUENCE

mpltseries(arg1,...,argn)

PARAMETERS

Input

* argi = arguments that can be:

  -the series to graph, which can take any of these types:

    . a time series

    . a real (nxp) vector

    . a string equal to the name of a time series or a (nxp) real vector between quotes

    . a matrix or a list of such elements

optional arguments:

  - 'nseries=x' the number series to draw on each graph (default=1)

  - 'order=x' to change the order of appearance of the series in the graphs. In the default mode (x=0) the series are plotted according to their order of appearance in the function call: The user can change the order in following 2 ways:

    . x = (1 x p) or (p x 1) vector containing the user defined order of appearance of each series

    . x = -1 the whole list of data is decomposed into b=p/nseries consecutive blocks (B) such that graph number i contains series B_1(i),...B_b(i).

  - 'ncol=x' the number of columns of the graph page (default=1)

  - 'title=x' if the user wants to give its own title to each graph

  - 'main_title=x' if the user wants to give a title to the whole graph page

  - 'legend=xx' with xx title of the legend for each graph

  - 'main_legend==xx' for an identical legend for all graphs

  - 'yaxex=xx' if the user wants to put the x axis at value

    .xx (default: y minimum value)

  - 'yaxis=xx' where xx is a (1 x nseries)  or (1 x p) matrix of 1 and 2, if the user wants 2 axes, respectively at the left and the of the graph; the j the series is represented on the left axis if xx(j) = = 1 and on the right one if xx(j) = = 2

  (default: only a left axis)

  - 'bars=xx' with xx integer row vector of size p representing the nature of the representation of the series (1=bars; anything else=curves)

  - 'bounds=[''b1'' ; ''b2'' ;...; ''bn'']' if the user wants to give its own grocer_bounds

  (default: the whole series)

  - 'x0(1)=xx' with xx integer representing the x location of the first y axis (default: put at x = 1)

  - 'x0(2)=xx' with xx integer representing the x location of the second y axis (default: put at x s= nobs)

  - 'x=xx' where xx is the (1xnobs) string vector to put on the x axis

  - 'ntics=xx' with xx an integer representing number of of tics between 2 occurences of the axis values

  - 'styleg=xx' with xx integer representing the location of the legend

  (default: 5, that is the legend is placed interactively with the mouse, see legends in the help menu)

  - 'color=xx' with xx an integer row vector of size nseries representing the line color of each series

  - 'shade=xx' a (nx1) vector composed of 0 and 1 where the ones delimit areas to be shaded

  - 'mycolor=[r1,g1,b1;...;rp,gp,bp]' for user defined colors with ri,gi,bi the RGB integer values of a color

  - 'style=xx' with xx' an integer row vector of size nseries representing the line style of each series

  - 'thickn=xx' with xx an integer vector of size p representing the thickness of the line drawn for each series (default all equal to 1)

  - 'styleg=xx' with xx an integer representing the location of the legend (default: 5, that is the legend is placed interactively with the mouse, see legends in the help menu)

  - 'font_title=xx' with xx the size of the title font

  - 'font_main_title=xx' with xx the size of the main title

  - 'font_axis=xx' with xx the size of the axis font

  - 'font_legend=xx' with xx the size of the legend font

  - 'font_main_legend=xx' with xx the size of the main legend font

  - 'style_title=xx' with xx the font style of the title

  - 'yaxis=xx' with xx integer row vector of size p representing the axis for each series (1=left; 2=right)

  - 'bars=xx' with xx integer row vector of size p representing the nature of the representation of the

   series (1 = bars; anything else = curves)

  - 'window=x' if the user wants to specify the # x where the graph is plotted (default: the window 1)

  - 'just_scale=bool' with bool a boolean which is:

    . %T if you want the y scale to be exactly the length [min(y),max(y)]

    . %F if you want the y scale to begin and end with rounded numbers (default)

 

Output

* nothing (printed on a graphic window)

DESCRIPTION

Plots several graphs on one page... This function allows the user to make some complex graphs by gathering in one function some capabilities emboddied in scilab graphic functions drawaxis, legend and xset. The user can graph vectors and martrices, as with plot2d, but also timeseries. She can choose to use 2 y axes instead of one by setting the option 'yaxis=...'. She can choose the position of the x axis with the option 'yaxex=...'. She can control the color and style of the lines and the location of the legend.

EXAMPLE

load(GROCERDIR+'/data/bdhenderic.dat');
mpltseries('lm1','ly','lp','rnet','title=[lm1;ly;lp;rnet]','noleg','main_title=Hendry-Ericsson database',...
'font_title=2','font_main_title=4') ;
// Example 1 shows how to plot several time series on the same page with a head title and a title on each graphs
load(GROCERDIR+'/data/DataFex.dat');
 tsmat_pi=ts2tsmat('zepic','jppic','ukpic','uspic');
tsmat_r=ts2tsmat('zermmkt','jprmmkt',ukrmmkt','usrmmkt')
mpltseries(tsmat_r,tsmat_pi,'nseries=2','ncol=2','yaxis=[1,2]','window=1','main_title=Inflation and monetary policy',...
'title=[Euro area;Japan;UK;US]','main_legend=[interest rate (3 month, lhs) ;inflation (rhs)]',...
'font_main_title=4','font_title=3','font_legend=2');
// This is a more complex use. The user converts the time series into tsmat format
// and graph for a set of countries the inflation and the short term interest rate (option 'nseries=2')
// with a dual scale ('yaxis=[1,2]', one could have also used yaxis=[1,1,1,1,2,2,2,2]).
// The graph page contains 2 columns, a head title, a graph title and a head legend.
// Fonts are respectively set to 4, 3 and 2.
// The same graph could also have been generated wuthout any use of tsmat
// by simply replacing the two tsmat by the name of the corresponding ts.

AUTHOR

Éric Dubois / Emmanuel Michaux 2008

Report an issue
<< mat2latex Printings and graphs ndigits >>