Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9064d16

Browse files
committed
Improved docstring for matplotlib package
svn path=/trunk/matplotlib/; revision=3535
1 parent 943e401 commit 9064d16

1 file changed

Lines changed: 51 additions & 138 deletions

File tree

lib/matplotlib/__init__.py

Lines changed: 51 additions & 138 deletions
Original file line numberDiff line numberDiff line change
@@ -1,144 +1,57 @@
11
"""
22
This is an object-orient plotting library.
33
4-
The following matlab(TM) compatible commands are provided by
5-
6-
>>> from pylab import *
7-
8-
Plotting commands
9-
10-
axes - Create a new axes
11-
axhline - draw a horizontal line across axes
12-
axvline - draw a vertical line across axes
13-
axhspan - draw a horizontal bar across axes
14-
axvspan - draw a vertical bar across axes
15-
axis - Set or return the current axis limits
16-
bar - make a bar chart
17-
barh - a horizontal bar chart
18-
boxplot - make a box and whisker plot
19-
cla - clear current axes
20-
clf - clear a figure window
21-
close - close a figure window
22-
colorbar - add a colorbar to the current figure
23-
cohere - make a plot of coherence
24-
contour - make a contour plot
25-
csd - make a plot of cross spectral density
26-
draw - Force a redraw of the current figure
27-
errorbar - make an errorbar graph
28-
figlegend - make legend on the figure rather than the axes
29-
figimage - make a figure image
30-
figtext - add text in figure coords
31-
figure - create or change active figure
32-
fill - make filled polygons
33-
gca - return the current axes
34-
gcf - return the current figure
35-
gci - get the current image, or None
36-
get - get a handle graphics property
37-
gray - set the current colormap to gray
38-
jet - set the current colormap to jet
39-
hist - make a histogram
40-
hold - set the axes hold state
41-
legend - make an axes legend
42-
loglog - a log log plot
43-
imread - load image file into array
44-
imshow - plot image data
45-
pcolor - make a pseudocolor plot
46-
plot - make a line plot
47-
psd - make a plot of power spectral density
48-
rc - control the default params
49-
savefig - save the current figure
50-
scatter - make a scatter plot
51-
set - set a handle graphics property
52-
semilogx - log x axis
53-
semilogy - log y axis
54-
show - show the figures
55-
specgram - a spectrogram plot
56-
stem - make a stem plot
57-
subplot - make a subplot (numrows, numcols, axesnum)
58-
table - add a table to the plot
59-
text - add some text at location x,y to the current axes
60-
title - add a title to the current axes
61-
xlim - set/get the xlimits
62-
ylim - set/get the ylimits
63-
xticks - set/get the xticks
64-
yticks - set/get the yticks
65-
xlabel - add an xlabel to the current axes
66-
ylabel - add a ylabel to the current axes
67-
68-
Matrix commands
69-
70-
cumprod - the cumulative product along a dimension
71-
cumsum - the cumulative sum along a dimension
72-
detrend - remove the mean or besdt fit line from an array
73-
diag - the k-th diagonal of matrix
74-
diff - the n-th differnce of an array
75-
eig - the eigenvalues and eigen vectors of v
76-
eye - a matrix where the k-th diagonal is ones, else zero
77-
find - return the indices where a condition is nonzero
78-
fliplr - flip the rows of a matrix up/down
79-
flipud - flip the columns of a matrix left/right
80-
linspace - a linear spaced vector of N values from min to max inclusive
81-
ones - an array of ones
82-
rand - an array from the uniform distribution [0,1]
83-
randn - an array from the normal distribution
84-
rot90 - rotate matrix k*90 degress counterclockwise
85-
squeeze - squeeze an array removing any dimensions of length 1
86-
tri - a triangular matrix
87-
tril - a lower triangular matrix
88-
triu - an upper triangular matrix
89-
vander - the Vandermonde matrix of vector x
90-
svd - singular value decomposition
91-
zeros - a matrix of zeros
92-
93-
Probability
94-
95-
levypdf - The levy probability density function from the char. func.
96-
normpdf - The Gaussian probability density function
97-
rand - random numbers from the uniform distribution
98-
randn - random numbers from the normal distribution
99-
100-
Statistics
101-
102-
corrcoef - correlation coefficient
103-
cov - covariance matrix
104-
max - the maximum along dimension m
105-
mean - the mean along dimension m
106-
median - the median along dimension m
107-
min - the minimum along dimension m
108-
norm - the norm of vector x
109-
prod - the product along dimension m
110-
ptp - the max-min along dimension m
111-
std - the standard deviation along dimension m
112-
sum - the sum along dimension m
113-
114-
Time series analysis
115-
116-
bartlett - M-point Bartlett window
117-
blackman - M-point Blackman window
118-
cohere - the coherence using average periodiogram
119-
csd - the cross spectral density using average periodiogram
120-
fft - the fast Fourier transform of vector x
121-
hamming - M-point Hamming window
122-
hanning - M-point Hanning window
123-
hist - compute the histogram of x
124-
kaiser - M length Kaiser window
125-
psd - the power spectral density using average periodiogram
126-
sinc - the sinc function of array x
127-
128-
Other
129-
130-
angle - the angle of a complex array
131-
polyfit - fit x, y to an n-th order polynomial
132-
polyval - evaluate an n-th order polynomial
133-
roots - the roots of the polynomial coefficients in p
134-
trapz - trapezoidal integration
135-
136-
137-
Credits: The plotting commands were provided by
138-
John D. Hunter <[email protected]>
139-
140-
Most of the other commands are from the Numeric, MLab and FFT, with
141-
the exception of those in mlab.py provided by matplotlib.
4+
A procedural interface is provided by the companion pylab
5+
module, which may be imported directly, e.g.
6+
7+
from pylab import *
8+
9+
or using ipython:
10+
11+
ipython -pylab
12+
13+
For the most part, direct use of the object-oriented library
14+
is encouraged when programming rather than working
15+
interactively. The exceptions are the pylab commands
16+
figure(), subplot(), show(), and savefig(), which can
17+
greatly simplify scripting.
18+
19+
Modules include:
20+
axes: defines the Axes class. Most pylab commands are
21+
wrappers for Axes methods. The axes module is the
22+
highest level of OO access to the library.
23+
figure: defines Figure class.
24+
artist: defines the Artist base class for all classes
25+
that draw things.
26+
line: defines Line2D class for drawing lines and markers
27+
patches: defines classes for drawing polygons
28+
text: defines Text, TextWithDash, and Annotate classes
29+
image: defines AxesImage and FigureImage classes
30+
collections: classes for efficient drawing of groups of
31+
lines or polygons
32+
colors: classes for interpreting color specifications
33+
and for making colormaps
34+
cm: colormaps and the ScalarMappable mixin class for
35+
providing color mapping functionality to other
36+
classes
37+
ticker: classes for calculating tick mark locations and
38+
for formatting tick labels
39+
backends: a subpackage with modules for various gui
40+
libraries and output formats
41+
42+
The base matplotlib namespace includes:
43+
rcParams: a dictionary of default configuration
44+
settings. It is initialized by code which may be
45+
overridded by a matplotlibrc file.
46+
rc(): a function for setting groups of rcParams values
47+
use(): a function for setting the matplotlib backend.
48+
If used, this function must be called immediately
49+
after importing matplotlib for the first time. In
50+
particular, it must be called *before* importing
51+
pylab (if pylab is imported).
52+
53+
matplotlib is written by John D. Hunter (jdh2358 at
54+
gmail.com).
14255
"""
14356
from __future__ import generators
14457

0 commit comments

Comments
 (0)