[Top] [Contents] [Index] [ ? ]

PyChart Reference Manual

1. Introduction  
2. Examples  
3. Anatomy of a Chart  
4. PyChart Options  
5. Attributes  
6. Coordinate System  
7. Input Data  
8. Area  
9. Axes  
10. Line and Scatter Plots  
11. Range Plots  
12. Bar Plots  
13. Pie Plots  
14. Legends  
15. Line Styles  
16. Tick Marks  
17. Colors  
18. Fill Styles  
19. Texts  
20. Annotation  
21. Arrows  
22. Error Bars  
23. Generating Color Plots  
24. Tricks  
Index  


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1. Introduction

PyChart{} is a Python library for creating "professional" quality charts. It produces line plots, bar plots, range-fill plots, and pie charts in Postscript or PDF.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2. Examples


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.1 Line plot

linetest

This example draws a simple line plot. Below is the source code used to produce this chart.

linetest.py:
 
# This line imports all the chart modules.
from pychart import *

# We have 10 sample points total.  The first value in each tuple is
# the X value, and subsequent values are Y values for different lines.
data = [(10, 20, 30), (20, 65, 33),
        (30, 55, 30), (40, 45, 51),
        (50, 25, 27), (60, 75, 30),
        (70, 80, 42), (80, 62, 32),
        (90, 42, 39), (100, 32, 39)]

# The format attribute speficies the text to be drawn at each tick mark.
# Here, texts are rotated -60 degrees ("/a-60"), left-aligned ("/hL"),
# and numbers are printed as integers ("%d"). 
xaxis = axis.X(format="/a-60/hL%d", tic_interval = 20, label="Stuff")
yaxis = axis.Y(tic_interval = 20, label="Value")

# Define the drawing area. "y_range=(0,None)" tells that the Y minimum
# is 0, but the Y maximum is to be computed automatically. Without
# y_ranges, Pychart will pick the minimum Y value among the samples,
# i.e., 20, as the base value of Y axis.
ar = area.T(x_axis=xaxis, y_axis=yaxis, legend=legend.T(),
            y_range=(0,None))

# The first plot extracts Y values from the 2nd column
# ("ycol=1") of DATA ("data=data"). X values are takes from the first
# column, which is the default.
plot = line_plot.T(label="foo", data=data, ycol=1, tick_mark=tick_mark.star)
plot2 = line_plot.T(label="bar", data=data, ycol=2, tick_mark=tick_mark.square)

ar.add_plot(plot, plot2)

# The call to ar.draw() usually comes at the end of a program.  It
# draws the axes, the plots, and the legend (if any).

ar.draw()

To produce the chart, just feed the file to Python.

 
% python linetest.py >linetest.eps

Or, to produce a PDF chart, run python like below (see section 4. PyChart Options).

 
% setenv PYCHART_OPTIONS "output=pdf"
% python linetest.py >linetest.pdf

Every pychart program starts with from pychart import * to import all the objects and functions provided by PyChart{}. Each chart is represented by the area object, which defines the size , the coordinate system (linear, log, etc), and all the plots to be drawn in the chart. The final line of the program should end with area.draw() that draws all the components of the chart to the standard output.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.2 Bar plot

bartestv

Above example is a little more complicated chart. the below program generates this chart.

 
from pychart import *

data = [(10, 20, 30, 5), (20, 65, 33, 5), (30, 55, 30, 5), (40, 45, 51, 7),
        (50, 25, 27, 3), (60, 75, 30, 5), (70, 80, 42, 5), (80, 62, 32, 5),
        (90, 42, 39, 5), (100, 32, 39, 4)]

# The attribute y_coord_system="category" tells that the Y axis values
# should be taken from samples, y_category_col'th column of
# y_category_data.  Thus, in this example, Y values will be
# [40,50,60,70,80].
ar = area.T(y_coord_system = 'category', 
            y_category_data = data[3:8], y_category_col = 0,
            x_range = (0,100), 
            x_axis=axis.X(label="X label", tic_interval=20, 
                  grid_interval=20, grid_style=line_style.gray5dash1),
            y_axis=axis.Y(label="Y label"), legend = legend.T(),
            bg_style = fill_style.gray9,
            border_line_style = line_style.default)

# Below call sets the default attributes for all bar plots.
chart_object.set_defaults(bar_plot.T, direction="horizontal", data=data)

ar.add_plot(bar_plot.T(label="foo", cluster=(0,3)))
ar.add_plot(bar_plot.T(label="bar", hcol=2, cluster=(1,3)))
ar.add_plot(bar_plot.T(label="baz", hcol=3, cluster=(2,3)))
ar.draw()




[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3. Anatomy of a Chart

A chart comprises a set of components. Each component belongs to a certain class, from which an instance tailored for a particular chart is generated. The standard set of component classes follow:

area.T
The area class defines the size, the location, and the coordinate system (linear, logarithmic, etc) of a chart (see section 8. Area). It also contains axes, plots, and legends, as described below. At least one Area needs to be created in any chart.

axis.X
axis.Y
The axis class defines the look of an axis. You can specify, for example, the interval and the style of tick marks and grid lines (see section 9. Axes). PyChart and axis.Y, corresponding to horizontal and vertical axes.

plot.T
The plot class actually draws a chart. Several subclasses of plots are provided by PyChart{}, including line plots (see section 10. Line and Scatter Plots), range-fill plots (see section 11. Range Plots), bar plots (see section 12. Bar Plots), and pie plots (see section 13. Pie Plots). You can draw multiple plots in a single chart, and most of the times you can even mix different types of plots, e.g., line plots and bar plots.

legend.T
The legend class is an optional rectangular box that describes what each plot means (see section 14. Legends).

text_box.T
The text_box is an optional rectangular box that contains arbitrary text. It can also contain arrows (see section 20. Annotation).

canvas.T
The canvas is a "virtual paper" that defines graph-drawing primitives, such as lines, rectangles, and texts. Canvas is used by other components in the graph, and usually it is not manipulated directly by users. It's handy, however, if you want to draw a line/circle/text/etc, directly on the Postscript or PDF file (see section 24.1 Drawing Arbitrary Objects on Canvas).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4. PyChart Options

An environment variable `PYCHART_OPTIONS' is used to control the behavior of PyChart{}. The value of this variable is a sequence of `var=val' separated by commas. No space between commas is allowed. Below is an example, which tells PyChart{} to direct output to file `foo.pdf' and use Times-Roman as the default font.

 
PYCHART_OPTIONS="output=foo.pdf,font-family=Times"


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5. Attributes

Each component in a chart (see section 3. Anatomy of a Chart) is described by a collection of attributes. For example, Axis (see section 9. Axes) includes an integer tic_len attribute that defines the length of "tick" lines drawn perpendicular to the axis. It also has an integer tic_interval attribute that defines the separation between tick lines. (For the full list of Axis's attributes, See section 9. Axes.)

Attributes are usually specified via named arguments while creating components:

 
ax = axis.X(tic_len = 3, tic_interval = 50)

Attributes can also be changed after a component is created, but before area.draw(), the main drawing function (see section 8. Area), is called. The below example has the same effect as the above.

 
ax = axis.X()
ax.tic_len = 3
ax.tic_interval = 50

Each attribute has a default value that supposedly gives you a standard look to the chart. You can change the default values through chart_object module. For example, the below example has the same effect as the above, except that all X axes that may be created in the future have the new default values.

 
chart_object.set_defaults(axis.X, tic_len=3, tic_interval=50)
ax = axis.X()


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6. Coordinate System


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.1 Unit of Length

Lengths are measured by "Postscript points", which coincides with TeX points. One point is equal to 1/72 inch. Several variables and functions are provided to manipulate lengths:

Variable: scaling.scale_factor
Defines chart magnification. The default value is 1.0, meaning that value 1 actually means one postscript points. Setting this value to 3.0, for example, makes PyChart{} drawn everything three times larger.

Function: area.x_pos VALUE
Converts X VALUE to a coordinate on the canvas (see section 24.1 Drawing Arbitrary Objects on Canvas).

Function: area.y_pos VALUE
Converts Y VALUE to a coordinate on the canvas (see section 24.1 Drawing Arbitrary Objects on Canvas).

 
ar = area.T(loc=(50, 50), size=(100, 100), 
            xrange=(0,200), yrange=(0, 1000))
px = ar.x_pos(50)
py = ar.y_pos(100)

In the above example, the chart is drawn on the area defined by rectangle (50, 50) - (150, 150). The point (px, py) will be at (75, 60), which is the screen location at which the point (50, 100) would be drawn (i.e., 50 + 100 * 50/200 = 75, 50 + 100 * 100 / 1000 = 60).

6.2 Plane Orientation  


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.2 Plane Orientation

In PyChart{}, X axis grows to the right, and Y axis grows up (same as Postscript, but different from X and Windows).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7. Input Data

The basic function of PyChart{} is to draw samples in a variety of ways. Samples are simply a sequence of sequences, where "sequence" is a Python term that stands for either a tuple (comma-separated numbers enclosed in parenthesis) or a list (comma-separated numbers enclosed in square brackets). Data are given to plots through the "data" attribute:

 
l = line_plot.T(data=[(10,20), (11,38), (12,29)], xcol=0, ycol=1)

In the above example, three sample points will be drawn along with line segments that connect them: (10, 20) - (11, 38) - (12, 29). Attribute xcol tells the locations of X values within data (the first column of each sample in data), and ycol similarly tell the locations of Y values (the last column of each sample in data). Module chart_data is provided to create data in various ways.

Function: chart_data.read_csv FILE, DELIM = ','

This function reads comma-separated samples from FILE. Empty lines and lines beginning with "`#'" are ignored. DELIM specifies how values in each line are separated. If it does not contain the letter "%", then DELIM is simply used to split each line into values. Otherwise, this function acts like scanf in C:

 
chart_data.read_csv("file", "%d,%s:%d")

This function currently supports only three conversion specifiers: "d"(int), "f"(double), and "s"(string).

Function: chart_data.fread_csv FP, DELIM=','
This function is similar to read_csv, except that it reads from an open file handle FP.

 
fp = open("foo", "r")
data = chart_data.fread_csv(fp, ",")

Function: chart_data.read_str DELIM, LINES
This function is similar to read_csv, but it reads data from the list of LINES.

 
fp = open("foo", "r")
data = chart_data.read_str(",", fp.readlines())

Function: chart_data.func F, FROM, TO, STEP

Create sample points from function F, which must be a single-parameter function that returns a number (e.g., math.sin). FROM and TO specify the first and last X values, and STEP specfies the sampling interval.

 
sin_samples = chart_data.func(math.sin, 0, math.pi*4, 0.1)

Function: chart_data.filter F, DATA

F must be a single-argument function that takes a sequence (i.e., a sample point) and returns a boolean. Filter calls F on each element in data and returns a list comprising elements for which F returns true.

 
data = [[1,5], [2,10], [3,13], [4,16]]
data2 = chart_data.filter(lambda x: x[1] % 2 == 0, data)
# data2 will become [[2,10], [4,16]].

Function: chart_data.extract_rows DATA, ROWS...

Extract rows specified in the argument list.

 
data2 = chart_data.extract_rows([[10,20], [30,40], [50,60]], 1, 2)
# data2 will become [[30,40],[50,60]].

Function: chart_data.extract_columns DATA, COLS...

Extract columns specified in the argument list.

 
data2 = chart_data.extract_columns([[10,20], [30,40], [50,60]], 0)
# data2 will become [[10],[30],[50]].

Function: chart_data.transform F, DATA

Apply function F on each element in DATA and return the list consisting of the return values from F.

 
data = [[10,20], [30,40], [50,60]]
data2 = chart_data.transform(lambda x: [x[0], x[1]+1], data)
# data2 will become [[10, 21], [30, 41], [50, 61]].

Function: chart_data.moving_average DATA, XCOL, YCOL, WIDTH

Compute the moving average of YCOL'th column of each sample point in DATA. In particular, for each element I in DATA, this function extracts up to WIDTH*2+1 elements, consisting of I itself, WIDTH elements before I, and WIDTH elements after I. It then computes the mean of the YCOL'th column of these elements, and it composes a two-element sample consisting of XCOL'th element and the mean.

 
data = [[10,20], [20,30], [30,50], [40,70], [50,5]]
data2 = chart_data.moving_average(data, 0, 1, 1)

In the above example, data2 will be computed as:

 
[(10, (20+30)/2), (20, (20+30+50)/3), (30, (30+50+70)/3), 
  (40, (50+70+5)/3), (50, (70+5)/2)]


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8. 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.

Attribute Type Default Description
bg_style fill_style.T None Background of the chart. See section 18. Fill Styles.
border_line_style line_style.T None Line style of the frame that surrounds the chart. See section 15. Line Styles.
legend legend.T None The legend of the chart. See section 14. Legends.
loc (x,y) (0, 0) Bottom-left corner of the chart.
size (x,y) (120, 110) Size of the chart drawing area, excluding axis labels, legends, tick marks, etc.
x_axis axis.X None The X axis. See section 9. Axes..
x_category_col int 0 Selects values from 'x_category_data'.
x_category_data list None Meaningful only when x_coord_system = 'category'. 'x_category_col'th column of each tuple in x_category_data defines the set of X values.
x_coord_system linear /log /category linear Either 'linear', 'log' or 'category'. Linear and log makes x coordinate scaled linearly or logarithmically. Category enumerates the X values through x_category_data and x_category_col attributes.
x_grid_over_plot int 0 If true, grid lines are drawn over plots.
x_log_base int 10
x_range (x,y) None The minimum and maximum X values.
y_axis axis.Y None The Y axis. See section 9. Axes..
y_category_col int 1 See x_category_col.
y_category_data list None See x_category_data.
y_coord_system linear /log /category linear Set the Y coordinate scaling. See also x_coord_system.
y_grid_over_plot int 0 See x_grid_over_plot.
y_log_base int 10
y_range (x,y) None The minimum and maximum Y values.
y_zap (x,y) None Compress the section.
y_zap_entire_area int None If 1, then the entire area is horizontally `zapped'.

Objects of area.T also define several methods:

Function: add_plot PLOT, ...
Add plots. plot must be a plot. See section 10. Line and Scatter Plots, 12. Bar Plots, 13. Pie Plots, 11. Range Plots.

Function: draw
Draw plots, axes, and the legend. This procedure must be called at the end of every PyChart{} application.

Function: x_pos VAL
Converts X VAL to Postscript points. See section 6. Coordinate System

Function: y_pos VAL
Converts Y VAL to Postscript points. See section 6. Coordinate System


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

9. Axes

Module Axis defines the look of an axis as well as grid lines. Two classes, `axis.X' and `axis.Y', are provided by this module.

axis.X

Attribute Type Default Description
first_tic_value number None The location of the first tick mark. Defaults to the x_range[0] (or y_range[0]) of the area.
format printf format string %s The format string for tick labels. It can be a `printf' style format string, or a single-parameter function that returns a string. See section 19. Texts..
grid_interval Number or function None When the value is a number, it specifies the interval with which grid lines are drawn. Otherwise, the value must be a function. It must take no argument and return the list of numbers, which specifies the X or Y points where grid lines are drawn.
grid_style line_style.T None The style of grid lines. See section 15. Line Styles.
label string axis label The description of the axis. See section 19. Texts..
label_offset (x,y) or None (None, None) The location where the axis label is drawn. Relative to the left-bottom corner of the axis.
line_style line_style.T default The style of tick lines. See section 15. Line Styles.
minor_tic_interval Number or function None When the value is a number, it specifies the interval with which minor tick marks are drawn. Otherwise, the value must be a function. It must take no argument and return the list of numbers, which specifies the X or Y points where minor tick marks are drawn.
minor_tic_len number 3 The length of minor tick marks.
tic_interval Number or function None When the value is a number, it specifies the interval with which tick marks are drawn. Otherwise, the value must be a function. It must take no argument and return the list of numbers, which specifies the X or Y points where tick marks are drawn.
tic_label_offset (x,y) (0, 0) The location where the tick labels is drawn. Relative to the tip of the tick mark.
tic_len number 6 The length of tick lines

axis.Y

Attribute Type Default Description
first_tic_value number None The location of the first tick mark. Defaults to the x_range[0] (or y_range[0]) of the area.
format printf format string %s The format string for tick labels. It can be a `printf' style format string, or a single-parameter function that returns a string. See section 19. Texts..
grid_interval Number or function None When the value is a number, it specifies the interval with which grid lines are drawn. Otherwise, the value must be a function. It must take no argument and return the list of numbers, which specifies the X or Y points where grid lines are drawn.
grid_style line_style.T gray7dash3 See section 15. Line Styles.
label string axis label The description of the axis. See section 19. Texts..
label_offset (x,y) or None (None, None) The location where the axis label is drawn. Relative to the left-bottom corner of the axis.
line_style line_style.T default The style of tick lines. See section 15. Line Styles.
minor_tic_interval Number or function None When the value is a number, it specifies the interval with which minor tick marks are drawn. Otherwise, the value must be a function. It must take no argument and return the list of numbers, which specifies the X or Y points where minor tick marks are drawn.
minor_tic_len number 3 The length of minor tick marks.
tic_interval Number or function None When the value is a number, it specifies the interval with which tick marks are drawn. Otherwise, the value must be a function. It must take no argument and return the list of numbers, which specifies the X or Y points where tick marks are drawn.
tic_label_offset (x,y) (0, 0) The location where the tick labels is drawn. Relative to the tip of the tick mark.
tic_len number 6 The length of tick lines


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

10. Line and Scatter Plots

Attribute Type Default Description
data any None Specifies the data points. See section 7. Input Data.
data_label_format printf format string None The format string for label printed besides each sample point. It can be a `printf' style format string, or a two-parameter function that takes the (x, y) values and returns a string. See section 19. Texts..
data_label_offset (x,y) (0, 5) Location of the data label relative to the sample point.
error_bar error_bar.Base None The style of the error bar. See section 22. Error Bars.
label string ??? The label to be displayed in the legend. See section 14. Legends., See section 19. Texts.
line_style line_style.T <function <lambda> at 8155280> The style of the line. See section 15. Line Styles.
q_max_col int None See section 22. Error Bars.
q_min_col int None See section 22. Error Bars.
tick_mark tick_mark.Base None Tick marks to be displayed at each sample point.
xcol int 0 The X values of sample points are extracted from " XCOL'th column of data. See section 7. Input Data.
y_max_col int None The height of the errorbar is extracted from this column in data. See section 22. Error Bars.
y_min_col int 2 The depth of the errorbar is extracted from this column in data. See section 22. Error Bars.
ycol int 1 The X values of sample points are extracted from " YCOL'th column of data. See section 7. Input Data.

linetest3

Sample line plot

Below is the source code that produces Figure \ref{fig:linetest3}:
 
from pychart import *

data = chart_data.read_csv("lines.csv")

xaxis=axis.X(label="X", tic_interval=10)
yaxis=axis.Y(label="Y", tic_interval=10)
ar = area.T(x_range=(0,100), y_range=(0,100), x_axis=xaxis, y_axis=yaxis)
eb = error_bar.error_bar2(tic_len=5, hline_style=line_style.gray5)
ar.add_plot(line_plot.T(label="foo", data=data, error_bar=eb, y_min_col=3),
            line_plot.T(label="bar", data=data, ycol=2, error_bar=eb, y_min_col=3))
ar.draw()

tb = text_box.T(loc=(40, 130), text="This is\nimportant!", line_style=None)
tb.add_arrow((ar.x_pos(data[6][0]), ar.y_pos(data[6][1])), "cb")
tb.draw()

ar = area.T(loc=(200, 0), x_range=(0,100), y_range=(0,100),
            x_axis=xaxis, y_axis=yaxis, legend=legend.T())
ar.add_plot(line_plot.T(label="foo", data=data, data_label_format="/8{}%d"),
            line_plot.T(label="bar", data=data, ycol=2))
ar.draw()

Scatter plots can be created by setting the line_style attribute to None. See the next example.

scattertest

Sample scatter plot

Below is the source code that produces Figure \ref{fig:scattertest}:
 
from pychart import *
import whrandom

def randomdata():
    data = []
    for i in range(0, 30):
        data.append((whrandom.random() * 1000, whrandom.random() * 1000))
    return data

chart_object.set_defaults(line_plot.T, line_style=None)

tick1 = tick_mark.Circle(size=2)
tick2 = tick_mark.Circle(size=2, fill_style=fill_style.black)
xaxis = axis.X(label="foo", format="/a-60{}%d")
yaxis = axis.Y(label="bar")

ar = area.T(x_axis=xaxis, y_axis=yaxis, 
            legend = legend.T(loc=(350, 50)), loc = (0, 0))

ar.add_plot(line_plot.T(label="plot1", data=randomdata(), tick_mark=tick1))
ar.add_plot(line_plot.T(label="plot2", data=randomdata(), tick_mark=tick2))
ar.draw()

xaxis = axis.X(label="foo", format="/a-30{}%d",
               grid_interval=10, grid_style=line_style.gray7dash3)
yaxis = axis.Y(label="bar")
ar = area.T(x_axis=xaxis, y_axis=yaxis, 
            x_coord_system='log', y_coord_system='log', loc = (200, 0))

ar.add_plot(line_plot.T(label="plot1", data=randomdata(), tick_mark=tick1))
ar.add_plot(line_plot.T(label="plot2", data=randomdata(), tick_mark=tick2))
ar.draw()


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

11. Range Plots

Attribute Type Default Description
data any None Specifies the data points. See section 7. Input Data.
fill_style fill_style.T default See section 18. Fill Styles.
label string ??? The label to be displayed in the legend. See section 14. Legends., See section 19. Texts.
line_style line_style.T default The style of the boundary line. See section 15. Line Styles.
max_col int 2 The upper bound of the sweep is extracted from this column of data.
min_col int 1 The lower bound of the sweep is extracted from this column of data.
xcol int 0 The X values of sample points are extracted from " XCOL'th column of data. See section 7. Input Data.

rangetest

Sample range plot

Below is the source code that produces Figure \ref{fig:rangetest}:
 
from pychart import *

data = [ (0, 10, 30, 40, 60),
         (10, 20, 40, 50, 55),
         (20, 10, 35, 38, 43),
         (30, 8, 30, 35, 39),
         (40, 8, 20, 28, 39) ]

ar = area.T(x_axis = axis.X(label="X axis"),
            y_axis = axis.Y(label="Y axis", grid_interval = 10, grid_style = line_style.white),
            y_grid_over_plot=1, legend = legend.T())

if theme.use_color:
    colors = [ fill_style.dark_sea_green, fill_style.white, fill_style.brown]
else:
    colors = [ fill_style.gray9, fill_style.white, fill_style.gray5]
ar.add_plot(range_plot.T(label="foo", data=data, fill_style = colors[0]))
ar.add_plot(range_plot.T(label="bar", data=data, min_col=2, max_col=3,
                         fill_style = colors[1]))
ar.add_plot(range_plot.T(label="baz", data=data, min_col=3, max_col=4, fill_style = colors[2]))
ar.draw()


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

12. Bar Plots

Attribute Type Default Description
bcol int 0 Base (i.e., X when DIRECTION is vertical, Y otherwise) value of each bar is extracted this column in data.
cluster tuple (0, 1) foo
cluster_sep number 0 Separation between clustered boxes
data any None Specifies the data points. See section 7. Input Data.
data_label_format printf format string None The format string for label printed besides each bar. It can be a `printf' style format string, or a two-parameter function that takes (x,y) values and returns a string. See section 19. Texts..
data_label_offset (x,y) (0, 5) Location of data label relative to the sample point.
direction string vertical The direction the bars grows. Either 'horizontal' or 'vertical'.
error_bar error_bar.Base None The style of the error bar. See section 22. Error Bars.
fill_style fill_style.T <function <lambda> at 8157b60> Fill style of each box. See section 18. Fill Styles.
hcol int 1 Height of each bar is extracted this column in data.
label string ??? The label to be displayed in the legend. See section 14. Legends., See section 19. Texts.
line_style line_style.T default The style of the outer frame of each box. See section 15. Line Styles.
q_max_col int None
q_min_col int None
stack_on any None Each bar of this plot is stacked on top of the plot specified by this value.
width number 5 Width of each box.
y_max_col int None The depth of the errorbar is extracted from this column in data.
y_min_col int 2 The depth of the errorbar is extracted from this column in data.

bartest

Sample bar charts

Below is the source code that produces Figure \ref{fig:bartest}:
 
from pychart import *

data = [(10, 20, 30, 5), (20, 65, 33, 5),
        (30, 55, 30, 5), (40, 45, 51, 7), (50, 25, 27, 3)]

chart_object.set_defaults(area.T, size = (150, 120), y_range = (0, None),
                          x_coord_system = 'category',
                          x_category_data = data, x_category_col = 0)

chart_object.set_defaults(bar_plot.T, data = data)

# Draw the 1st graph. The Y upper bound is calculated automatically.
ar = area.T(legend = legend.T(), 
            x_axis=axis.X(label="X label", format="/a-30{}%d"),
            y_axis=axis.Y(label="Y label", tic_interval=10))

plot1=bar_plot.T(label="foo", cluster=(0, 3))
plot2=bar_plot.T(label="bar", hcol=2, cluster=(1, 3))
plot3=bar_plot.T(label="baz", hcol=3, cluster=(2, 3))
ar.add_plot(plot1, plot2, plot3)
ar.draw()

ar = area.T(legend = legend.T(), loc=(250,0),
            x_axis=axis.X(label="X label", format="/a-30{}%d"),
            y_axis=axis.Y(label="Y label", tic_interval=10))

bar_plot.fill_styles.reset();
plot1=bar_plot.T(label="foo")
plot2=bar_plot.T(label="bar", hcol=2, stack_on = plot1)
plot3=bar_plot.T(label="baz", hcol=3, stack_on = plot2)

ar.add_plot(plot1, plot2, plot3)
ar.draw()


bartestv

Vertical bar chart

Below is the source code that produces Figure \ref{fig:bartestv}:
 
from pychart import *

data = [(10, 20, 30, 5), (20, 65, 33, 5), (30, 55, 30, 5), (40, 45, 51, 7),
        (50, 25, 27, 3), (60, 75, 30, 5), (70, 80, 42, 5), (80, 62, 32, 5),
        (90, 42, 39, 5), (100, 32, 39, 4)]

# The attribute y_coord_system="category" tells that the Y axis values
# should be taken from samples, y_category_col'th column of
# y_category_data.  Thus, in this example, Y values will be
# [40,50,60,70,80].
ar = area.T(y_coord_system = 'category', 
            y_category_data = data[3:8], y_category_col = 0,
            x_range = (0,100), 
            x_axis=axis.X(label="X label", tic_interval=20, 
                  grid_interval=20, grid_style=line_style.gray5dash1),
            y_axis=axis.Y(label="Y label"), legend = legend.T(),
            bg_style = fill_style.gray9,
            border_line_style = line_style.default)

# Below call sets the default attributes for all bar plots.
chart_object.set_defaults(bar_plot.T, direction="horizontal", data=data)

ar.add_plot(bar_plot.T(label="foo", cluster=(0,3)))
ar.add_plot(bar_plot.T(label="bar", hcol=2, cluster=(1,3)))
ar.add_plot(bar_plot.T(label="baz", hcol=3, cluster=(2,3)))
ar.draw()




[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

13. Pie Plots

Attribute Type Default Description
arc_offsets list None
arrow_style arrow.T None See section 21. Arrows.
center (x,y) None
data any None
data_col int 1
fill_styles list ['black', 'gray7', 'diag', 'gray3', 'rdiag', 'gray1', 'diag2', 'white', 'rdiag2', 'vert', 'diag3', 'gray5', 'horiz', 'gray9', 'rdiag3', 'wave', 'vwave', 'stitch', 'lines']
label_col int 0
label_fill_style fill_style.T default See section 18. Fill Styles.
label_line_style line_style.T None See section 15. Line Styles.
label_offset number None
line_style line_style.T default See section 15. Line Styles.
radius number None
shadow (xoff,yoff,fill) None
start_angle number 90

pietest

Sample pie chart

Below is the source code that produces Figure \ref{fig:pietest}:
 
from pychart import *

import sys
data = [("foo", 10),("bar", 20), ("baz", 30), ("ao", 40)]

ar = area.T(size=(150,150), legend=legend.T())

plot = pie_plot.T(data=data, arc_offsets=[0,10,0,10],
                  shadow = (2, -2, fill_style.gray5),
                  label_offset = 25,
                  arrow_style = arrow.a3)
ar.add_plot(plot)
ar.draw()



[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

14. Legends

Attribute Type Default Description
bottom_fudge number 3 Amount of space below the last line.
frame_fill_style fill_style.T white See section 18. Fill Styles.
frame_line_style line_style.T default See section 15. Line Styles.
inter_row_sep number 0 Space between each entry in the legend.
left_fudge number 5 Amount of space left of the legend.
loc (x,y) None Bottom-left corner of the legend.
right_fudge number 5 Amount of space right of the legend.
shadow (xoff,yoff,fill) None
top_fudge number 0 Amount of space above the first line.

The default location of a legend is the bottom-right end of the chart.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

15. Line Styles

Attribute Type Default Description
cap_style int 0 Line cap style. 0: butt cap, 1: round cap, 2: projecting square cap. See also Postscript/PDF reference.
color color.T default See section 17. Colors.
dash tuple None The 2N'th value specifies the length of the line, and 2N+1'th value specfies the length of the blank. None draws a solid line.
join_style int 0 Join style. 0: Miter join, 1: round join, 2: bevel join
width number default_line_width Width of the line, in points.

linestyles

Standard line styles. These styles are referred to by names line_style.name, where name is the labels below them.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

16. Tick Marks

Tick marks are used in conjunction with line plots (see section 10. Line and Scatter Plots) to show where sample points are. PyChart{} defines several standard tick marks shown below.

Attribute Type Default Description
fill_style fill_style.T white See section 18. Fill Styles.
line_style line_style.T default See section 15. Line Styles.
size number 5 Size of the tick mark.

Several tick mark classes, which are subtypes of tick_mark.Base, are provided by PyChart{}. They include: tick_mark.Circle, tick_mark.Square, tick_mark.Triangle, tick_mark.DownTriangle, tick_mark.X, TIckMark.Plus, tick_mark.Diamond, tick_mark.Star, tick_mark.Null.

Specific instance of tick mark classes are also defined for your convenience. Below is the list of such standard tick marks. They are refered to by as "tick_mark.name", where name is the labels below them.

tickmarks


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

17. Colors

Attribute Type Default Description
b number O_RDONLY The intensity of blue. The value is between 0 and 1.
g number O_RDONLY The intensity of green. The value is between 0 and 1.
r number O_RDONLY The intensity of red. The value is between 0 and 1.

You can use all the colors defined in X rgb.txt (usually at `/usr/X11R6/lib/X11/rgb.txt'). The below shows some of the standard colors defined in the module. They are refereed to by the names color.name (e.g., color.gray1).

colors


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

18. Fill Styles

The class fill_style.T determins the color and the pattern of the background of a region.

Attribute Type Default Description
bgcolor color.T white The background color. See section 17. Colors.
line_interval number 3 The interval between successive stitch lines.
line_style line_style.T default The style of the line. See section 15. Line Styles.

The actual background patterns are offered by subclasses of fill_style.T:

Function: fill_style.Plain

This class just fills the region in the specified color. The attributes `line_style' and `line_interval' are ignored.

Function: fill_style.Diag
Fills the region with diagonal lines.

Function: fill_style.Rdiag
Fills the region with diagonal lines (but tilted in the opposite direction from `fill_style.Diag').

Function: fill_style.Vert
Fills the region with vertical lines.

Function: fill_style.Horiz
Fills the region with horizontal lines.

Function: fill_style.Stitch
Fills the region with horizontal and vertical lines.

Function: fill_style.Wave
Fills the region with horizontal wavy lines.

Function: fill_style.Vwave
Fills the region with vertical wavy lines.

Function: fill_style.Lines
Fills the region with a series of short line segments.

The below picture shows the standard set of fill styles. They are named like fill_style.name, where name are the labels shown in the picture.

fillstyles

Just for your information, the "rdiag3" style shown in the picture can be created manually by the following code:

 
rdiag3 = fill_style.Rdiag(line_style=line_style.T(width=3, color=color.gray5),
                          line_interval=6)    


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

19. Texts

Text strings may contain escape characters that control its appearance.

fonttest

 
from pychart import *
import re

x = 100
y = 500

def escape_text(str):
    s = re.sub("/", "//", str)
    s = re.sub("\\{", "/{", s)
    s = re.sub("\\}", "/}", s)
    return s

def show_text(str):
    global x, y
    canvas.show(x, y, str)
    e = "/16/C" + escape_text(str)
    canvas.show(x+200, y, e)
    y = y - 20

show_text("/16/hLLeft align")
show_text("/16/hRRight align")
show_text("/16/hCCenter align")
show_text("/a20/16/hRAngled text")

def show_textv(str):
    global x, y
    canvas.show(x, y, str)
    x = x + 150

y = y - 40
x = 100
show_textv("/16/vT//16//vTTop align")
show_textv("/16/vM//16//vT/16Middle align")
show_textv("/16/vB//16//vT/16Bottom align")

y = y - 40
x = 100
show_text("/16/HHelvetica")
show_text("/16/CCourier")
show_text("/16/NHelvetica-Narrow")
show_text("/16/PPalatino-Roman")
show_text("/16/BBookman-Demi")
show_text("/16/AAvantgarde")
show_text("/16/T/iTimes-Italic")
show_text("/16/SSymbol")

Sequence Meaning
/add Specifies the angle the text is drawn. Parameter dd is a number between -360 to 360. Value 0 means left-to-right text, 90 means bottom-to-up, etc. If you want to print numbers right after an angle specification, put {} between the angle and the number. For example, the below code shows string ""100"" at 60-degree angle.
 
"/a60{}100"
/hA Specifies horizontal alignment of the text. A is one of "L" (left alignment), "R" (right alignment), "C" (center alignment).
/vA Specifies vertical alignment of the text. A is one of "B" (bottom), "T" (top), "M" (middle).
/T Switch to Times-Roman font family.
/H Switch to Helvetica font family.
/C Switch to Courier font family.
/B Switch to Bookman-Demi font family.
/A Switch to AvantGarde-Book font family.
/P Switch to Palatino font family.
/S Switch to Symbol font family.
/b Switch to bold typeface.
/i Switch to italic typeface.
/o Switch to oblique typeface.
/dd Set font size to dd points.
 
"/20{}2001 space odyssey!"
`/c'dd Set grayscale to 0.dd. Grayscale of 0 means black, 1 means white. `//', `/{', `/}' Display `/', `}', or `{'. `{ ... }' Limit the scope of escape sequences. `\n' Break the line.

Restriction: `/h', `/v', and `/a' must appear at the beginning of a string.

The font module defines several procedures and variables for manipulating fonts:

Function: font.text_height TEXT
Return the height of the text in points.

Function: font.text_width TEXT
Return the width of the text in points.

Function: font.get_dimension TEXT
Return tuple (xmin, xmax, ymin, ymax)

Variable: font.default_family
Default font family (Helvetica).

Variable: font.default_size
Default font size (9).

Variable: font.default_halign
Default horizontal alignment (h)

Variable: font.default_valign
Default vertical alignment (b)

Variable: font.default_angle
Default angle (0)


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

20. Annotation

Attribute Type Default Description
arrows list new_list List of arrows. Not to be touched by the application directly
bottom_fudge number 5 Space below the last line
fill_style fill_style.T white Box fill style. See section 18. Fill Styles.
left_fudge number 5 Space left of the box
line_style line_style.T default Frame box style. See section 15. Line Styles.
loc tuple (0, 0) Location of the text box.
radius number 0 Radius of the four corners of the rectangle.
right_fudge number 5 Space right of the box
shadow (xoff,yoff,fill) None
text string ??? Text body. See section 19. Texts.
top_fudge number 0 Space above the first line

In addition to the above attributes, it provides the following methods.

Function: add_arrow TIP, TAIL=None, ARROW=arrow.default

This method adds a straight arrow that points to TIP, which is a tuple of integers. TAIL is a string consisting of the following letters: 'l', 'c', or 'r' means to start the arrow from the left, center, or right of the text box, respectively. 't', 'm', or 'b' means to start the arrow from the top, middle or bottom of the text box. For example, when `tail = 'tc'' then arrow is drawn from top-center vertex of the text box. `arrow' specifies the style of the arrow. (see section 21. Arrows).

annotations

 
from pychart import *

a1 = text_box.T(loc=(100,100), text="Without frame")
a1.add_arrow((50, 100))
a1.add_arrow((180, 100))
a1.draw()

a1 = text_box.T(loc=(100,130), text="/hCMulti\n/bLine")
a1.add_arrow((50, 120))
a1.add_arrow((180, 100))
a1.draw()

a1 = text_box.T(loc=(100,160), text="Fat arrow", line_style=None)
a1.add_arrow((180, 140), tail='rm', arrow = arrow.fat1)
a1.draw()

a1 = text_box.T(loc=(180, 100), text="/a90Funny background",
                fill_style = fill_style.gray7)
a1.draw()

a1 = text_box.T(loc=(180, 140), text="/hL/20Big/oText\n/24/bHuge/oText",
                fill_style = None)
a1.draw()


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21. Arrows

Attribute Type Default Description
head_color color.T default color of the arrow head. See section 17. Colors.
head_len number 8 Length of the arrow head.
head_style int 1 0 draws a triangular arrow head. 1 draws a swallow-tail arrow head
line_style line_style.T default Line style. See section 15. Line Styles.
thickness number 4 Length of the base of the arrow head.

arrows


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

22. Error Bars

error_bar.error_bar1
Attribute Type Default Description
line_style line_style.T default See section 15. Line Styles. See section 15. Line Styles.
tic_len number 10 Length of the horizontal bars

error_bar.error_bar2
Attribute Type Default Description
hline_style line_style.T default The style of the horizontal bars. See section 15. Line Styles.. See section 15. Line Styles.
tic_len number 10 The length of the horizontal bars
vline_style line_style.T None The style of the vertical bar. See section 15. Line Styles.

error_bar.error_bar3
Attribute Type Default Description
line_style line_style.T default See section 15. Line Styles.

error_bar.error_bar4
Attribute Type Default Description
box_width number 4
fill_style fill_style.T gray7 See section 18. Fill Styles.
line_style line_style.T default See section 15. Line Styles.
tic_len number 4

errorbars


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

23. Generating Color Plots

First, you need to tell PyChart{} that you are using colors by giving option "`color=yes'" in the command line:

 
% PYCHART_OPTIONS="color=yes"
% export PYCHART_OPTIONS
% python foo.py

This option has several effects:


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

24. Tricks

24.1 Drawing Arbitrary Objects on Canvas  
24.2 Clipping  
24.3 Changing the output  


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

24.1 Drawing Arbitrary Objects on Canvas

The `canvas' object, used internally by PyChart{}, can be invoked manually if you desire so.

Function: canvas.line LINESTYLE, X1, Y1, X2, Y2

 
# draw a line segment from (10,20) to (100, 200)
canvas.line(line_style.blackdash1, 10, 20, 100, 200)    

Function: canvas.polygon LINESTYLE, FILLSTYLE, [(X1,Y1), ..., (Xn, Yn)]

LINESTYLE can be None, in which case no perimeter lines are drawn. FILLSTYLE can also be None, in which the internal of the polygon are left undrawn.

 
canvas.polygon(line_style.default, fill_style.default, 
               [(10, 20), (100, 200), (300,300)])

Function: canvas.rectangle LINESTYLE, FILLSTYLE, X1, Y1, X2, Y2, SHADOW=None

Parameter shadow, if none, draws a drop-shadow. It should be a tuple of three values, (x_off, y_off, fill). {}

 
canvas.rectangle(line_style.default, fill_style.default, 
                 10, 20, 300, 300)

Function: canvas.ellipsis LINESTYLE, FILLSTYLE, X, Y, RADIUS, Y-ELONGATION=1, START=0, END=360, SHADOW=None

The start and end angles are specified in degrees; i.e., between 0 and 360. Parameter shadow, if none, draws a drop-shadow. It should be a tuple of three values, (x_off, y_off, fill). {}.

Function: canvas.round_rectangle LINESTYLE, FILLSTYLE, X1,Y2,X2,Y2,RADIUS,SHADOW=None

Parameter shadow, if none, draws a drop-shadow. It should be a tuple of three values, (x_off, y_off, fill). {}.

Function: canvas.curve LINESTYLE, [(X1,Y2), ..., (Xn, Yn)]
Draw a Bezier curve.

Function: canvas.show X, Y, TEXT

TEXT supports font manipulation, as defined in See section 19. Texts.

Function: canvas.verbatim STR

This procedure outputs an arbitrary Postscript code STR.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

24.2 Clipping

A rectangle, polygon, or ellipsis region can be defined for clipping. Any drawing commands (see section 24.1 Drawing Arbitrary Objects on Canvas) issued afterwards are confined in the region. You can even nest multiple clipping regions, in which case, drawings will be clipped to the intersection of the regions. canvas.endclip() ends the clipping. Clipping and endclip() must nest properly.

cliptest

 
from pychart import *

data = [(10, 20), (20, 65), (30, 55), (40, 45)]

# tic_angle is the angle X values are displayed below the axis.
xaxis = axis.X(label="Stuff")
yaxis = axis.Y(label="Value")

ar = area.T(x_axis=xaxis, y_axis=yaxis)

plot = line_plot.T(label="foo", data=data, xcol=0, ycol=1,
                   tick_mark=tick_mark.star)

ar.add_plot(plot)

canvas.ellipsis(line_style.T(width=1.5,dash=(4,4)), None, 30, 20, 80, 0.8)
canvas.clip_ellipsis(30, 20, 80, 0.8)
ar.draw()
canvas.endclip()


Function: canvas.clip X1, Y1, X2, Y2,

This function starts clipping on the rectangular region.

 
canvas.clip(x,y,x2,y2)
draw something ...
canvas.endclip()

Function: canvas.clip_ellipsis X, Y, RADIUS, Y_ELONGATION

 
canvas.clip_ellipsis(x,y,radius,ratio)
draw something ...
canvas.endclip()

Function: canvas.clip_polygon [(X1,Y2),(X2,Y2), ..., (Xn, Yn)]
 
canvas.clip_polygon([(x1,y1),(x2,y2),...,(xn,yn)])
draw something ...
canvas.endclip()


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

24.3 Changing the output

To change the output stream to something other than stdout, do like below:

 
fp = open(...)
canvas.newcanvas(fp)


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

Index

Jump to:   A   B   C   D   E   F   G   H   I   J   L   M   O   P   Q   R   S   T   U   V   W   X   Y  

Index Entry Section

A
add_arrow20. Annotation
add_plot8. Area
alignment (text)19. Texts
annotation20. Annotation
arc_offsets13. Pie Plots
area8. Area
area.T3. Anatomy of a Chart
area.T3. Anatomy of a Chart
area.x_pos6.1 Unit of Length
area.y_pos6.1 Unit of Length
arrow20. Annotation
arrow_style13. Pie Plots
arrows20. Annotation
attribute5. Attributes
average7. Input Data
axis6.2 Plane Orientation
axis9. Axes
axis.X3. Anatomy of a Chart
axis.X3. Anatomy of a Chart
axis.X9. Axes
axis.X9. Axes
axis.Y3. Anatomy of a Chart
axis.Y3. Anatomy of a Chart
axis.Y9. Axes
axis.Y9. Axes

B
b17. Colors
bar plot12. Bar Plots
bcol12. Bar Plots
Bezier curve24.1 Drawing Arbitrary Objects on Canvas
bg_style8. Area
bgcolor18. Fill Styles
border_line_style8. Area
bottom_fudge14. Legends
bottom_fudge20. Annotation
box_width22. Error Bars

C
canvas.clip24.2 Clipping
canvas.clip_ellipsis24.2 Clipping
canvas.clip_polygon24.2 Clipping
canvas.curve24.1 Drawing Arbitrary Objects on Canvas
canvas.ellipsis24.1 Drawing Arbitrary Objects on Canvas
canvas.endclip24.2 Clipping
canvas.line24.1 Drawing Arbitrary Objects on Canvas
canvas.polygon24.1 Drawing Arbitrary Objects on Canvas
canvas.rectangle24.1 Drawing Arbitrary Objects on Canvas
canvas.round_rectangle24.1 Drawing Arbitrary Objects on Canvas
canvas.show24.1 Drawing Arbitrary Objects on Canvas
canvas.T3. Anatomy of a Chart
canvas.T3. Anatomy of a Chart
canvas.verbatim24.1 Drawing Arbitrary Objects on Canvas
cap_style15. Line Styles
center13. Pie Plots
chart_data.extract_columns7. Input Data
chart_data.extract_rows7. Input Data
chart_data.filter7. Input Data
chart_data.fread_csv7. Input Data
chart_data.func7. Input Data
chart_data.moving_average7. Input Data
chart_data.read_csv7. Input Data
chart_data.read_str7. Input Data
chart_data.transform7. Input Data
chart_object5. Attributes
clipping24.2 Clipping
cluster12. Bar Plots
cluster_sep12. Bar Plots
color15. Line Styles
colors17. Colors
coordinate6.2 Plane Orientation

D
dash15. Line Styles
data7. Input Data
data11. Range Plots
data12. Bar Plots
data13. Pie Plots
data_col13. Pie Plots
data_label_format10. Line and Scatter Plots
data_label_format12. Bar Plots
data_label_offset10. Line and Scatter Plots
data_label_offset12. Bar Plots
default attribute values5. Attributes
direction12. Bar Plots
draw5. Attributes

E
ellipsis24.1 Drawing Arbitrary Objects on Canvas
error bar22. Error Bars
error_bar10. Line and Scatter Plots
error_bar12. Bar Plots

F
file name4. PyChart Options
fill_style11. Range Plots
fill_style12. Bar Plots
fill_style16. Tick Marks
fill_style20. Annotation
fill_style22. Error Bars
fill_style.Diag18. Fill Styles
fill_style.Horiz18. Fill Styles
fill_style.Lines18. Fill Styles
fill_style.Plain18. Fill Styles
fill_style.Rdiag18. Fill Styles
fill_style.Stitch18. Fill Styles
fill_style.Vert18. Fill Styles
fill_style.Vwave18. Fill Styles
fill_style.Wave18. Fill Styles
fill_styles13. Pie Plots
Filter7. Input Data
first_tic_value9. Axes
first_tic_value9. Axes
font19. Texts
font19. Texts
font.default_angle19. Texts
font.default_family19. Texts
font.default_halign19. Texts
font.default_size19. Texts
font.default_valign19. Texts
font.get_dimension19. Texts
font.text_height19. Texts
font.text_width19. Texts
format9. Axes
format9. Axes
frame_fill_style14. Legends
frame_line_style14. Legends

G
g17. Colors
grid_interval9. Axes
grid_interval9. Axes
grid_style9. Axes
grid_style9. Axes

H
hcol12. Bar Plots
head_color21. Arrows
head_len21. Arrows
head_style21. Arrows
hline_style22. Error Bars

I
inter_row_sep14. Legends

J
join_style15. Line Styles
justification (text)19. Texts

L
label9. Axes
label9. Axes
label10. Line and Scatter Plots
label11. Range Plots
label12. Bar Plots
label_col13. Pie Plots
label_fill_style13. Pie Plots
label_line_style13. Pie Plots
label_offset9. Axes
label_offset9. Axes
label_offset13. Pie Plots
left_fudge14. Legends
left_fudge20. Annotation
legend8. Area
legend.T3. Anatomy of a Chart
legend.T3. Anatomy of a Chart
line24.1 Drawing Arbitrary Objects on Canvas
line plot10. Line and Scatter Plots
line width4. PyChart Options
line_interval18. Fill Styles
line_style9. Axes
line_style9. Axes
line_style10. Line and Scatter Plots
line_style11. Range Plots
line_style12. Bar Plots
line_style13. Pie Plots
line_style16. Tick Marks
line_style18. Fill Styles
line_style20. Annotation
line_style21. Arrows
line_style22. Error Bars
line_style22. Error Bars
line_style22. Error Bars
loc8. Area
loc14. Legends
loc20. Annotation

M
marquee24.1 Drawing Arbitrary Objects on Canvas
max_col11. Range Plots
mean7. Input Data
min_col11. Range Plots
minor_tic_interval9. Axes
minor_tic_interval9. Axes
minor_tic_len9. Axes
minor_tic_len9. Axes

O
output file name4. PyChart Options

P
PDF4. PyChart Options
pie plot13. Pie Plots
plot.T3. Anatomy of a Chart
plot.T3. Anatomy of a Chart
points6.1 Unit of Length
polygon24.1 Drawing Arbitrary Objects on Canvas
Postscript4. PyChart Options
Postscript6.1 Unit of Length
Postscript8. Area
Postscript24.1 Drawing Arbitrary Objects on Canvas
PYCHART_OPTIONS4. PyChart Options

Q
q_max_col10. Line and Scatter Plots
q_max_col12. Bar Plots
q_min_col10. Line and Scatter Plots
q_min_col12. Bar Plots

R
r17. Colors
radius13. Pie Plots
radius20. Annotation
range plot11. Range Plots
rectangle24.1 Drawing Arbitrary Objects on Canvas
rgb.txt17. Colors
right_fudge14. Legends
right_fudge20. Annotation
round_rectangle24.1 Drawing Arbitrary Objects on Canvas

S
samples7. Input Data
scale_factor6.1 Unit of Length
scaling.scale_factor6.1 Unit of Length
scanf7. Input Data
Scatter plot10. Line and Scatter Plots
scatter plot10. Line and Scatter Plots
set_defaults5. Attributes
shadow13. Pie Plots
shadow14. Legends
shadow20. Annotation
size8. Area
size16. Tick Marks
stack_on12. Bar Plots
start_angle13. Pie Plots

T
text20. Annotation
text19. Texts
text24.1 Drawing Arbitrary Objects on Canvas
text_box20. Annotation
text_box.T3. Anatomy of a Chart
text_box.T3. Anatomy of a Chart
thickness21. Arrows
tic_interval9. Axes
tic_interval9. Axes
tic_label_offset9. Axes
tic_label_offset9. Axes
tic_len9. Axes
tic_len9. Axes
tic_len22. Error Bars
tic_len22. Error Bars
tic_len22. Error Bars
tick mark16. Tick Marks
tick_mark10. Line and Scatter Plots
top_fudge14. Legends
top_fudge20. Annotation

U
unit of length6.1 Unit of Length

V
vline_style22. Error Bars

W
width12. Bar Plots
width15. Line Styles

X
X axis6.2 Plane Orientation
X axis9. Axes
x_axis8. Area
x_category_col8. Area
x_category_data8. Area
x_coord_system8. Area
x_grid_over_plot8. Area
x_log_base8. Area
x_pos8. Area
x_range8. Area
xcol7. Input Data
xcol10. Line and Scatter Plots
xcol11. Range Plots

Y
Y axis6.2 Plane Orientation
Y axis9. Axes
y_axis8. Area
y_category_col8. Area
y_category_data8. Area
y_coord_system8. Area
y_grid_over_plot8. Area
y_log_base8. Area
y_max_col10. Line and Scatter Plots
y_max_col12. Bar Plots
y_min_col10. Line and Scatter Plots
y_min_col12. Bar Plots
y_pos8. Area
y_range8. Area
y_zap8. Area
y_zap_entire_area8. Area
ycol7. Input Data
ycol10. Line and Scatter Plots

Jump to:   A   B   C   D   E   F   G   H   I   J   L   M   O   P   Q   R   S   T   U   V   W   X   Y  


[Top] [Contents] [Index] [ ? ]

Footnotes

(1)

In fact, you can use these color names in greyscale mode as well. They will appear in some gry color though.


[Top] [Contents] [Index] [ ? ]

Table of Contents


[Top] [Contents] [Index] [ ? ]

Short Table of Contents

1. Introduction
2. Examples
3. Anatomy of a Chart
4. PyChart Options
5. Attributes
6. Coordinate System
7. Input Data
8. Area
9. Axes
10. Line and Scatter Plots
11. Range Plots
12. Bar Plots
13. Pie Plots
14. Legends
15. Line Styles
16. Tick Marks
17. Colors
18. Fill Styles
19. Texts
20. Annotation
21. Arrows
22. Error Bars
23. Generating Color Plots
24. Tricks
Index

[Top] [Contents] [Index] [ ? ]

About this document

This document was generated by Yasushi Saito on April, 8 2002 using texi2html

The buttons in the navigation panels have the following meaning:

Button Name Go to From 1.2.3 go to
[ < ] Back previous section in reading order 1.2.2
[ > ] Forward next section in reading order 1.2.4
[ << ] FastBack previous or up-and-previous section 1.1
[ Up ] Up up section 1.2
[ >> ] FastForward next or up-and-next section 1.3
[Top] Top cover (top) of document  
[Contents] Contents table of contents  
[Index] Index concept index  
[ ? ] About this page  

where the Example assumes that the current position is at Subsubsection One-Two-Three of a document of the following structure:

This document was generated by Yasushi Saito on April, 8 2002 using texi2html