PyChart Reference Manual

Node:area, Next:bar_plot, Previous:chart_data, Up:Top

## Area

Class `area.T` defines the location and size of a chart. It also defines the coordinate system (linear, log, or enumeration) of the X and Y axes. The X coordinate system is defined using attribute `x_coord_system` attribute, which takes one of three strings: "linear", "log", "category". For the first two, the minimum and maximum displayable values in the area are either given explicitly via `x_range`, or is computed automatically from the plots when it is omitted. When `x_coord_system == "category"`, then the X axis takes discrete values, taken from `x_category_col`'th column of samples `x_category_data`. The the Y coordinate system can also be specified using the combination of attributes `y_coord_system`, `y_category_col`, and `y_category_data`.

    ar = area.T(x_coord_system = "log", x_range = (10, None), ...)

In the above example, an X axis is drawn with a logarithmic scale. The minimum value will be 10, and the maximum value will be computed from the values given to plots. The below is an example of a category coordinate system.

    samples = [("apple", 10), ("orange", 30), ("blueberry", 20)],
    ar = area.T(x_coord_system = "category",
                x_category_data = samples, x_category_col = 0)
    ar.add_plot(bar_plot.T(data = samples, ...))

XXX %%area.T

bg_style <class 'pychart.fill_style.T'> | Attribute

Default: None. Background fill-pattern.

border_line_style <class 'pychart.line_style.T'> | Attribute

Default: None. Line style of the outer frameof the chart.

legend <class 'pychart.legend.T'> | Attribute

Default: a legend is by default displayed in the right-center of the chart.. The legend of the chart.

loc (x,y) | Attribute

Default: (0, 0). The location of the bottom-left corner of the chart.

size (x,y) | Attribute

Default: (120, 110). The size of the chart-drawing area, excluding axis labels, legends, tick marks, etc.

x_axis <class 'pychart.axis.X'> | Attribute

Default: None. The X axis. See axis..

x_coord coord.T | Attribute

Default: A linear coordinate system.. Set the X coordinate system. See coord.. See coord.

x_grid_interval Number or function | Attribute

Default: None. The horizontal grid-line interval. A numeric value specifies the interval at which lines are drawn. If value is a function, it takes two arguments, (MIN, MAX), that tells the minimum and maximum values found in the sample data. The function should return a list of values at which lines are drawn.

x_grid_over_plot int | Attribute

Default: 0. If true, grid lines are drawn over plots. Otherwise, plots are drawn over grid lines.

x_grid_style <class 'pychart.line_style.T'> | Attribute

Default: None. The style of horizontal grid lines.

x_range (x,y) | Attribute

Default: None. Specifies the range of X values that are displayed in the chart. IF the value is None, both the values are computed automatically from the samples. Otherwise, the value must be a tuple of format (MIN, MAX). MIN and MAX must be either None or a number. If None, the value is computed automatically from the samples. For example, if x_range = (None,5), then the minimum X value is computed automatically, but the maximum X value is fixed at 5.

y_axis <class 'pychart.axis.Y'> | Attribute

Default: None. The Y axis. See axis..

y_coord coord.T | Attribute

Default: A linear coordinate system.. Set the Y coordinate system. See coord.. See coord.

y_grid_interval Number or function | Attribute

Default: None. The vertical grid-line interval. See also x_grid_interval

y_grid_over_plot int | Attribute

Default: 0. See x_grid_over_plot.

y_grid_style <class 'pychart.line_style.T'> | Attribute

Default: line_style.gray70_dash3. The style of vertical grid lines.

y_range (x,y) | Attribute

Default: None. Specifies the range of Y values that are displayed in the chart. IF the value is None, both the values are computed automatically from the samples. Otherwise, the value must be a tuple of format (MIN, MAX). MIN and MAX must be either None or a number. If None, the value is computed automatically from the samples. For example, if y_range = (None,5), then the minimum Y value is computed automatically, but the maximum Y value is fixed at 5.

Objects of `area.T` also define several methods:

add_plot PLOT, ... | Function

Add plots. `plot` must be a plot. See line_plot, bar_plot, pie_plot, range_plot.

area.draw | Function

Draw plots, axes, and the legend. This procedure must be called at the end of every PyChart application.

area.x_pos XVAL | Function

Converts X XVAL to a coordinate on the canvas (see canvas).

area.y_pos YVAL | Function

Converts Y YVAL to a coordinate on the canvas (see canvas).

- coord: Specifying the coordinate system. Linear, log, etc.
- axis: Displaying X and Y axes.