Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Eviews5 / EViews5 / Docs / EViews 5 Command Ref.pdf
Скачиваний:
91
Добавлен:
23.03.2015
Размер:
5.23 Mб
Скачать

setfillcolor—453

graph1.setelem(1) lcolor(blue)

graph1.setelem(1) linecolor(0, 0, 255)

are equivalent methods of setting the linecolor to blue.

graph1.setelem(1) fillgray(6)

sets the gray-scale color for the first graph element.

The lines:

graph1.setelem(1) scale(l)

graph1.setelem(2) scale(l)

graph1.setelem(3) scale(r)

create a dual scale graph where the first two series are scaled together and labeled on the left axis, and the third series is scaled and labeled on the right axis.

graph1.setelem(2) legend("gross domestic product")

sets the legend for the second graph element.

Cross-references

See Chapter 14, “Graphs, Tables, and Text Objects”, on page 413 of the User’s Guide for a discussion of graph options in EViews.

See also axis (p. 217), datelabel (p. 262), scale (p. 433) and options (p. 375).

setfillcolor

Table Proc

 

 

Set the fill (background) color of the specified table cells.

Syntax

Table Proc:

table_name.setfillcolor(cell_range) color_arg

where cell_range can take one of the following forms:

@all

Apply to all cells in the table.

 

 

cell

Cell identifier. You can identify cells using either the

 

column letter and row number (e.g., “A1”), or by using

 

“R” followed by the row number followed by “C” and

 

the column number (e.g., “R1C2”). Apply to cell.

 

 

row[,] col

Row number, followed by column letter or number

 

(e.g., “2,C”, or “2,3”), separated by “,”. Apply to cell.

 

 

454—Appendix B. Command Reference

row

Row number (e.g., “2”). Apply to all cells in the row.

 

 

col

Column letter (e.g., “B”). Apply to all cells in the col-

 

umn.

 

 

first_cell[:]last_cell,

Top left cell of the selection range (specified in “cell

first_cell[,]last_cell

format), followed by bottom right cell of the selection

 

range (specified in “cell” format), separated by a “:” or

 

“,” (e.g., “A2:C10”, “A2,C10”, or “R2C1:R10C3”,

 

“R2C1,R10C3”). Apply to all cells in the rectangular

 

region defined by the first cell and last cell.

first_cell_row[,] first_cell_col[,] last_cell_row[,] last_cell_col

Top left cell of the selection range (specified in “row[,] col” format), followed by bottom right cell of the selection range (specified in “row[,] col” format), separated by a “,” (e.g., “2,A,10,C” or “2,1,10,3”). Apply to all cells in the rectangular region defined by the first cell and last cell.

The color_arg specifies the color to be applied to the text in the cells. The color may be specified using predefined color names, or by specifying the individual red-green-blue (RGB) components using the special “@RGB” function. The latter method is obviously more difficult, but allows you to use custom colors.

The predefined colors are given by the keywords (with their RGB equivalents):

blue

@rgb(0, 0, 255)

 

 

red

@rgb(255, 0, 0)

 

 

green

@rgb(0, 128, 0)

 

 

black

@rgb(0, 0, 0)

 

 

white

@rgb(255, 255, 255)

 

 

purple

@rgb(128, 0, 128)

 

 

orange

@rgb(255, 128, 0)

 

 

yellow

@rgb(255, 255, 0)

 

 

gray

@rgb(128, 128, 128)

 

 

ltgray

@rgb(192, 192, 192)

 

 

Examples

To set a purple background color for the cell in the second row and third column of TAB1, you may use any of the following:

tab1.setfillcolor(C2) @rgb(128, 0, 128)

setfont—455

tab1.setfillcolor(2,C) @RGB(128, 0, 128)

tab1.setfillcolor(2,3) purple

tab1.setfillcolor(r2c3) purple

You may also specify a yellow color for the background of an entire column, or an entire row,

tab1.setfillcolor(C) @RGB(255, 255, 0)

tab1.setfillcolor(2) yellow

or for the background of the cells in a rectangular region:

tab1.setfillcolor(R2C3:R3C6) ltgray

tab1.setfillcolor(r2c3,r3c6) ltgray

tab1.setfillcolor(2,C,3,F) @rgb(192, 192, 192)

tab1.setfillcolor(2,3,3,6) @rgb(192, 192, 192)

Cross-references

For additional discussion of tables see Chapter 4, “Working with Tables”, on page 47.

See settextcolor (p. 467)and setfont (p. 455) for details on changing text color and font, and setlines (p. 465) for drawing lines between around and through cells. See setformat (p. 456) for setting cell formats.

setfont

Table Proc

 

 

Set the font for text in the specified table cells.

Syntax

Table Proc:

table_name.setfont(cell_range) font_args

where cell_range describes the table cells to be modified, and font_args is a set of arguments used to modify the existing font settings. See setfillcolor (p. 453) for the syntax for cell_range.

The font_args may include one or more of the following:

face_name

A string that specifies the typeface name of the font,

 

enclosed in double quotes.

 

 

integer[pt]

Integer font size, in points, followed by the “pt” identi-

 

fier (e.g., “12pt”).

 

 

+b / -b

[Add / remove] boldface.

456—Appendix B. Command Reference

+i / -i

[Add / remove] italics.

+s / -s

[Add / remove] strikethrough.

 

 

+u / -u

[Add / remove] underscore.

 

 

Examples

tab1.setfont(B3:D10) "Times New Roman" +i

sets the font to Times New Roman Italic for the cells defined by the rectangle from B3 (row 3, column 2) to D10 (row 10, column 4).

tab1.setfont(3,B,10,D) 8pt

changes all of text in the region to 8 point.

tab1.setfont(4,B) +b -i

removes the italic, and adds boldface to the B4 cell (row 4, column 2).

The commands:

tab1.setfont(b) -s +u 14pt

tab1.setfont(2) "Batang" 14pt +u

modify the fonts for the column B, and row 2, respectively. The first command changes the point size to 14, removes strikethrough and adds underscoring. The second changes the typeface to Batang, and adds underscoring,

Cross-references

For additional discussion of tables see Chapter 4, “Working with Tables”.

See settextcolor (p. 467) and setfillcolor (p. 453) for details on changing the text and cell background colors. See setformat (p. 456) for setting the cell formats.

setformat

Alpha Proc | Coef Proc | Group Proc | Matrix Proc | Series Proc | Rowvector Proc | Sym Proc | Table Proc | Vector Proc

Set the display format for cells in object spreadsheet and table views.

Syntax

Group Proc:

group_name.setformat(col_range) format_arg

Table Proc:

table_name.setformat(cell_range) format_arg

Object Proc:

object_name.setformat format_arg

setformat—457

where format_arg is a set of arguments used to specify format settings. If necessary, you should enclose the format_arg in double quotes.

The cell_range option is used to describe the columns to be updated in groups and the cells to be modified in tables. For all other objects, setformat operates on all of the cells in the object.

For groups, the col_range may take one of the following forms:

@all

Apply to all series in the group.

 

 

col

Column number or letter (e.g., “2”, “B”). Apply to the

 

series corresponding to the column.

 

 

first_col[:]last_col

Colon delimited range of columns (from low to high,

 

e.g., “3:5”). Apply to all series corresponding to the col-

 

umn range.

 

 

For tables, the cell_range may take one of the following forms:

@all

Apply to all cells in the table.

 

 

cell

Cell identifier. You can identify cells using either the col-

 

umn letter and row number (e.g., “A1”), or by using “R”

 

followed by the row number followed by “C” and the

 

column number (e.g., “R1C2”). Apply to cell.

 

 

row[,] col

Row number, followed by column letter or number (e.g.,

 

“2,C”, or “2,3”), separated by “,”. Apply to cell.

 

 

row

Row number (e.g., “2”). Apply to all cells in the row.

 

 

col

Column letter (e.g., “B”). Apply to all cells in the col-

 

umn.

 

 

first_cell[:]last_cell, Top left cell of the selection range (specified in “cell” for- first_cell[,]last_cell mat), followed by bottom right cell of the selection range

(specified in “cell” format), separated by a “:” or “,” (e.g., “A2:C10”, “A2,C10”, or “R2C1:R10C3”, “R2C1,R10C3”). Apply to all cells in the rectangular region defined by the first cell and last cell.

first_cell_row[,] first_cell_col[,] last_cell_row[,] last_cell_col

Top left cell of the selection range (specified in “row[,] col” format), followed by bottom right cell of the selection range (specified in “row[,] col” format), separated by a “,” (e.g., “2,A,10,C” or “2,1,10,3”). Apply to all cells in the rectangular region defined by the first cell and last cell.

458—Appendix B. Command Reference

To format numeric values, you should use one of the following format specifications:

g[.precision]

significant digits

 

 

f[.precision]

fixed decimal places

 

 

c[.precision]

fixed characters

 

 

e[.precision]

scientific/float

 

 

p[.precision]

percentage

 

 

r[.precision]

fraction

 

 

In order to set a format that groups digits into thousands, place a “t” after a specified format. For example, to obtain a fixed number of decimal places, with commas used to separate thousands, use “ft[.precision]”. To obtain a fixed number of characters with a period used to separate thousands, use “ct[..precision]”.

If you wish to display negative numbers surrounded by parentheses (i.e., display the number -37.2 as “(37.2)”), then you should enclose the format string in “()” (e.g., “f(.8)”).

To format numeric values using date and time formats, you may use a subset of the possible date format strings (see “Date Formats” on page 132). The possible format arguments, along with an example of the date number 730856.944793113 (January 7, 2002 10:40:30.125 p.m) formatted using the argument are given by:

WF

(uses current EViews workfile

 

date display format)

 

 

YYYY

“2002”

 

 

YYYY-Mon

“2002-Jan”

 

 

YYYYMon

“2002 Jan”

 

 

YYYY[M]MM

“2002[M]01”

 

 

YYYY:MM

“2002:01”

 

 

YYYY[Q]Q

“2002[Q]1”

 

 

YYYY:Q

“2002:Q

 

 

YYYY[S]S

“2002[S]1” (semi-annual)

 

 

YYYY:S

“2002:1”

 

 

YYYY-MM-DD

“2002-01-07”

 

 

YYYY Mon dd

“2002 Jan 7”

 

 

YYYY Month dd

“2002 January 7”

 

 

YYYY-MM-DD HH:MI

“2002-01-07 22:40”

 

 

YYYY-MM-DD HH:MI:SS

“2002-01-07 22:40:30”

setformat—459

YYYY-MM-DD HH:MI:SS.SSS

“2002-01-07 22:40:30.125”

Mon-YYYY

“Jan-2002”

 

 

Mon dd YYYY

“Jan 7 2002”

 

 

Mon dd, YYYY

“Jan 7, 2002”

 

 

Month dd YYYY

“January 7 2002”

 

 

Month dd, YYYY

“January 7, 2002”

 

 

MM/DD/YYYY

“01/07/2002”

 

 

mm/DD/YYYY

“1/07/2002”

 

 

mm/DD/YYYY HH:MI

“1/07/2002 22:40”

 

 

mm/DD/YYYY HH:MI:SS

“1/07/2002 22:40:30”

 

 

mm/DD/YYYY HH:MI:SS.SSS

“1/07/2002 22:40:30.125”

 

 

mm/dd/YYYY

“1/7/2002”

 

 

mm/dd/YYYY HH:MI

“1/7/2002 22:40”

 

 

mm/dd/YYYY HH:MI:SS

“1/7/2002 22:40:30”

 

 

mm/dd/YYYY HH:MI:SS.SSS

“1/7/2002 22:40:30.125”

 

 

dd/MM/YYYY

“7/01/2002”

 

 

dd/mm/YYYY

“7/1/2002”

 

 

DD/MM/YYYY

“07/01/2002”

 

 

dd Mon YYYY

“7 Jan 2002”

 

 

dd Mon, YYYY

“7 Jan, 2002”

 

 

dd Month YYYY

“7 January 2002”

 

 

dd Month, YYYY

“7 January, 2002”

 

 

dd/MM/YYYY HH:MI

“7/01/2002 22:40”

 

 

dd/MM/YYYY HH:MI:SS

“7/01/2002 22:40:30”

 

 

dd/MM/YYYY HH:MI:SS.SSS

“7/01/2002 22:40:30.125”

 

 

dd/mm/YYYY hh:MI

“7/1/2002 22:40”

 

 

dd/mm/YYYY hh:MI:SS

“7/1/2002 22:40:30”

 

 

dd/mm/YYYY hh:MI:SS.SSS

“7/1/2002 22:40:30.125”

 

 

hm:MI am

“10:40 pm“

 

 

hm:MI:SS am

“10:40:30 pm”

 

 

hm:MI:SS.SSS am

“10:40:30.125 pm”

 

 

HH:MI

“22:40”

 

 

HH:MI:SS

“22:40:30”

 

 

HH:MI:SS.SSS

“22:40:30.125”

460—Appendix B. Command Reference

hh:MI

“22:40”

hh:MI:SS

“22:40:30”

 

 

hh:MI:SS.SSS

“22:40:30.125”

 

 

Note that the “hh” formats display 24-hour time without leading zeros. In our examples above, there is no difference between the “HH” and “hh” formats for 10 p.m.

Also note that all of the “YYYY” formats above may be displayed using two-digit year “YY” format.

Examples

To set the format for a series or a matrix object to fixed 5-digit precision, simply provide the format specification:

ser1.setformat f.5

matrix1.setformat f.5

For groups, provide the column identifier and format. The commands:

group1.setformat(2) f(.7)

group1.setformat(c) e.5

set the formats for the second and third series in the group.

You may use any of the date formats given above:

ser2.setformat YYYYMon

group1(d).setformat "YYYY-MM-DD HH:MI:SS.SSS"

to set the series display characteristics.

For tables, you must provide a valid cell specification:

tab1.setformat(B2) hh:MI:SS.SSS

tab1.setformat(2,B,10,D) g(.3)

tab1.setformat(R2C2:R4C4) "dd/MM/YY HH:MI:SS.SSS"

Cross-references

For additional discussion of tables see Chapter 4, “Working with Tables”.

See also setfont (p. 455), settextcolor (p. 467) and setfillcolor (p. 453) for details on changing the text font and text and cell background colors.

Соседние файлы в папке Docs