Grocer Function
NAME
pltseries - 2d plot
CALLING SEQUENCE
pltseries(arg1,...,argn)
PARAMETERS
Input
in any order:
argi =
-
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) varargin:
- 'title=x' if the user wants to give its own title (default: the name of the ts if it has been given
between quotes, the string 'ts' if not)
- 'bounds=[''b1'' ; ''b2'' ;...; ''bn'']' if the user wants to give its own grocer_bounds
(default: the whole series)
- 'yaxex=xx' if the user wants to put the x axis at value
xx (default: y minimum value)
- 'yaxis=xx' where xx is a (1xp) matrix of 1 and 2, if the user wants 2 axes, respectively at the left and the
right 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)
- '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=nobs)
- 'x=xx' where xx is the (1xnobs) string vector to put on the x axis
- styleg = integer row vector of size p 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 = integer row vector of size p representing the line color of each series
- style = integer row vector of size p representing the line style of each series
- leg = title of the legend
- 'window=x' if the user wants to specify the # x where the graph is plotted (default: the window 1)
- 'x0=xx' with xx interger representing the y location of the x axis (default: put at y=1)
Output
-
nothing (printed on a graphic window)
DESCRIPTION
Plots series... 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
1) load('SCI/macros/grocer/db/bdhenderic.dat'); pltseries('delts(lm1)','delts(lp)')
2) pltseries('ly+lp-lm1','rnet','title=money velocity and interest rate',
'yaxis=[1 2 ]','leg=[money velocity (lhs);interest rate (rhs)','color=[2 6]','styleg=3',
'window=3','bounds=[''1968q1'';''1985q4'']')
Example 1 shows the simplest use of pltseries: only the series (here ts) are entered.
Example 2 shows a complex use: the user chooses her legend, title, colors, style and ts bounds. The legend is drawn
in the lower left-hand corner. The first series is represented along the lhs x scale and the second one along the rhs
y axis.
AUTHOR
Eric Dubois 2002