|
1 | 1 | """ |
2 | | -This is a procedural interface to the matplotlib object-oriented |
3 | | -plotting library. |
4 | | -
|
5 | | -The following plotting commands are provided; the majority have |
6 | | -MATLAB |reg| [*]_ analogs and similar arguments. |
7 | | -
|
8 | | -.. |reg| unicode:: 0xAE |
9 | | -
|
10 | | -_Plotting commands |
11 | | - acorr - plot the autocorrelation function |
12 | | - annotate - annotate something in the figure |
13 | | - arrow - add an arrow to the axes |
14 | | - axes - Create a new axes |
15 | | - axhline - draw a horizontal line across axes |
16 | | - axvline - draw a vertical line across axes |
17 | | - axhspan - draw a horizontal bar across axes |
18 | | - axvspan - draw a vertical bar across axes |
19 | | - axis - Set or return the current axis limits |
20 | | - autoscale - turn axis autoscaling on or off, and apply it |
21 | | - bar - make a bar chart |
22 | | - barh - a horizontal bar chart |
23 | | - broken_barh - a set of horizontal bars with gaps |
24 | | - box - set the axes frame on/off state |
25 | | - boxplot - make a box and whisker plot |
26 | | - violinplot - make a violin plot |
27 | | - cla - clear current axes |
28 | | - clabel - label a contour plot |
29 | | - clf - clear a figure window |
30 | | - clim - adjust the color limits of the current image |
31 | | - close - close a figure window |
32 | | - colorbar - add a colorbar to the current figure |
33 | | - cohere - make a plot of coherence |
34 | | - contour - make a contour plot |
35 | | - contourf - make a filled contour plot |
36 | | - csd - make a plot of cross spectral density |
37 | | - delaxes - delete an axes from the current figure |
38 | | - draw - Force a redraw of the current figure |
39 | | - errorbar - make an errorbar graph |
40 | | - figlegend - make legend on the figure rather than the axes |
41 | | - figimage - make a figure image |
42 | | - figtext - add text in figure coords |
43 | | - figure - create or change active figure |
44 | | - fill - make filled polygons |
45 | | - findobj - recursively find all objects matching some criteria |
46 | | - gca - return the current axes |
47 | | - gcf - return the current figure |
48 | | - gci - get the current image, or None |
49 | | - getp - get a graphics property |
50 | | - grid - set whether gridding is on |
51 | | - hist - make a histogram |
52 | | - ioff - turn interaction mode off |
53 | | - ion - turn interaction mode on |
54 | | - isinteractive - return True if interaction mode is on |
55 | | - imread - load image file into array |
56 | | - imsave - save array as an image file |
57 | | - imshow - plot image data |
58 | | - legend - make an axes legend |
59 | | - locator_params - adjust parameters used in locating axis ticks |
60 | | - loglog - a log log plot |
61 | | - matshow - display a matrix in a new figure preserving aspect |
62 | | - margins - set margins used in autoscaling |
63 | | - pause - pause for a specified interval |
64 | | - pcolor - make a pseudocolor plot |
65 | | - pcolormesh - make a pseudocolor plot using a quadrilateral mesh |
66 | | - pie - make a pie chart |
67 | | - plot - make a line plot |
68 | | - plot_date - plot dates |
69 | | - plotfile - plot column data from an ASCII tab/space/comma delimited file |
70 | | - pie - pie charts |
71 | | - polar - make a polar plot on a PolarAxes |
72 | | - psd - make a plot of power spectral density |
73 | | - quiver - make a direction field (arrows) plot |
74 | | - rc - control the default params |
75 | | - rgrids - customize the radial grids and labels for polar |
76 | | - savefig - save the current figure |
77 | | - scatter - make a scatter plot |
78 | | - setp - set a graphics property |
79 | | - semilogx - log x axis |
80 | | - semilogy - log y axis |
81 | | - show - show the figures |
82 | | - specgram - a spectrogram plot |
83 | | - spy - plot sparsity pattern using markers or image |
84 | | - stem - make a stem plot |
85 | | - subplot - make one subplot (numrows, numcols, axesnum) |
86 | | - subplots - make a figure with a set of (numrows, numcols) subplots |
87 | | - subplots_adjust - control the subplot positions of current figure |
88 | | - subplot_tool - launch the subplot configuration tool |
89 | | - suptitle - add a figure title |
90 | | - table - add a table to the plot |
91 | | - text - add some text at location (x, y) to the current axes |
92 | | - thetagrids - customize the radial theta grids and labels for polar |
93 | | - tick_params - control the appearance of ticks and tick labels |
94 | | - ticklabel_format - control the format of tick labels |
95 | | - title - add a title to the current axes |
96 | | - tricontour - make a contour plot on a triangular grid |
97 | | - tricontourf - make a filled contour plot on a triangular grid |
98 | | - tripcolor - make a pseudocolor plot on a triangular grid |
99 | | - triplot - plot a triangular grid |
100 | | - xcorr - plot the autocorrelation function of x and y |
101 | | - xlim - set/get the xlimits |
102 | | - ylim - set/get the ylimits |
103 | | - xticks - set/get the xticks |
104 | | - yticks - set/get the yticks |
105 | | - xlabel - add an xlabel to the current axes |
106 | | - ylabel - add a ylabel to the current axes |
107 | | -
|
108 | | - autumn - set the default colormap to autumn |
109 | | - bone - set the default colormap to bone |
110 | | - cool - set the default colormap to cool |
111 | | - copper - set the default colormap to copper |
112 | | - flag - set the default colormap to flag |
113 | | - gray - set the default colormap to gray |
114 | | - hot - set the default colormap to hot |
115 | | - hsv - set the default colormap to hsv |
116 | | - jet - set the default colormap to jet |
117 | | - pink - set the default colormap to pink |
118 | | - prism - set the default colormap to prism |
119 | | - spring - set the default colormap to spring |
120 | | - summer - set the default colormap to summer |
121 | | - winter - set the default colormap to winter |
122 | | -
|
123 | | -_Event handling |
124 | | -
|
125 | | - connect - register an event handler |
126 | | - disconnect - remove a connected event handler |
127 | | -
|
128 | | -_Matrix commands |
129 | | -
|
130 | | - cumprod - the cumulative product along a dimension |
131 | | - cumsum - the cumulative sum along a dimension |
132 | | - detrend - remove the mean or besdt fit line from an array |
133 | | - diag - the k-th diagonal of matrix |
134 | | - diff - the n-th difference of an array |
135 | | - eig - the eigenvalues and eigen vectors of v |
136 | | - eye - a matrix where the k-th diagonal is ones, else zero |
137 | | - find - return the indices where a condition is nonzero |
138 | | - fliplr - flip the rows of a matrix up/down |
139 | | - flipud - flip the columns of a matrix left/right |
140 | | - linspace - a linear spaced vector of N values from min to max inclusive |
141 | | - logspace - a log spaced vector of N values from min to max inclusive |
142 | | - meshgrid - repeat x and y to make regular matrices |
143 | | - ones - an array of ones |
144 | | - rand - an array from the uniform distribution [0, 1] |
145 | | - randn - an array from the normal distribution |
146 | | - rot90 - rotate matrix k*90 degrees counterclockwise |
147 | | - squeeze - squeeze an array removing any dimensions of length 1 |
148 | | - tri - a triangular matrix |
149 | | - tril - a lower triangular matrix |
150 | | - triu - an upper triangular matrix |
151 | | - vander - the Vandermonde matrix of vector x |
152 | | - svd - singular value decomposition |
153 | | - zeros - a matrix of zeros |
154 | | -
|
155 | | -_Probability |
156 | | -
|
157 | | - rand - random numbers from the uniform distribution |
158 | | - randn - random numbers from the normal distribution |
159 | | -
|
160 | | -_Statistics |
161 | | -
|
162 | | - amax - the maximum along dimension m |
163 | | - amin - the minimum along dimension m |
164 | | - corrcoef - correlation coefficient |
165 | | - cov - covariance matrix |
166 | | - mean - the mean along dimension m |
167 | | - median - the median along dimension m |
168 | | - norm - the norm of vector x |
169 | | - prod - the product along dimension m |
170 | | - ptp - the max-min along dimension m |
171 | | - std - the standard deviation along dimension m |
172 | | - asum - the sum along dimension m |
173 | | - ksdensity - the kernel density estimate |
174 | | -
|
175 | | -_Time series analysis |
176 | | -
|
177 | | - bartlett - M-point Bartlett window |
178 | | - blackman - M-point Blackman window |
179 | | - cohere - the coherence using average periodogram |
180 | | - csd - the cross spectral density using average periodogram |
181 | | - fft - the fast Fourier transform of vector x |
182 | | - hamming - M-point Hamming window |
183 | | - hanning - M-point Hanning window |
184 | | - hist - compute the histogram of x |
185 | | - kaiser - M length Kaiser window |
186 | | - psd - the power spectral density using average periodogram |
187 | | - sinc - the sinc function of array x |
188 | | -
|
189 | | -_Dates |
190 | | -
|
191 | | - date2num - convert python datetimes to numeric representation |
192 | | - drange - create an array of numbers for date plots |
193 | | - num2date - convert numeric type (float days since 0001) to datetime |
194 | | -
|
195 | | -_Other |
196 | | -
|
197 | | - angle - the angle of a complex array |
198 | | - load - Deprecated--please use loadtxt. |
199 | | - loadtxt - load ASCII data into array. |
200 | | - polyfit - fit x, y to an n-th order polynomial |
201 | | - polyval - evaluate an n-th order polynomial |
202 | | - roots - the roots of the polynomial coefficients in p |
203 | | - save - Deprecated--please use savetxt. |
204 | | - savetxt - save an array to an ASCII file. |
205 | | - trapz - trapezoidal integration |
206 | | -
|
207 | | -__end |
208 | | -
|
209 | | -.. [*] MATLAB is a registered trademark of The MathWorks, Inc. |
210 | | -
|
211 | | -
|
| 2 | +.. warning:: |
| 3 | + Since heavily importing into the global namespace may result in unexpected |
| 4 | + behavior, the use of pylab is strongly discouraged. Use `matplotlib.pyplot` |
| 5 | + instead. |
| 6 | +
|
| 7 | +`pylab` is a module that includes `matplotlib.pyplot`, `numpy`, `numpy.fft`, |
| 8 | +`numpy.linalg`, `numpy.random`, and some additional functions, all within |
| 9 | +a single namespace. Its original purpose was to mimic a MATLAB-like way |
| 10 | +of working by importing all functions into the global namespace. This is |
| 11 | +considered bad style nowadays. |
212 | 12 | """ |
213 | 13 |
|
214 | 14 | from matplotlib.cbook import flatten, silent_list, iterable, dedent |
|
0 commit comments