simple_annotate01
简单的Annotate01 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182import matplotlib.pyplot as pltimport matplotlib.patches as mpatchesfig, axs = plt.subplots(2, 4)x1, y1 = 0.3, 0.3x2, y2 = 0.7, 0.7ax = axs.flat[0]ax.plot([x1, x2], [y1, y2], "o")ax.annotate("", xy=(x1, y1), xycoords='data', xytext=(x2, y2), textcoords='data', ...
simple_legend02
简单的Legend02 1234567891011121314151617import matplotlib.pyplot as pltfig, ax = plt.subplots()line1, = ax.plot([1, 2, 3], label="Line 1", linestyle='--')line2, = ax.plot([3, 2, 1], label="Line 2", linewidth=4)# Create a legend for the first line.first_legend = ax.legend(handles=[line1], loc='upper right')# Add the legend manually to the current Axes.ax.add_artist(first_legend)# Create another legend for the second line.ax.legend(handles=[line2], loc='...
simple_legend01
简单的Legend01 123456789101112131415161718import matplotlib.pyplot as pltplt.subplot(211)plt.plot([1, 2, 3], label="test1")plt.plot([3, 2, 1], label="test2")# Place a legend above this subplot, expanding itself to# fully use the given bounding box.plt.legend(bbox_to_anchor=(0., 1.02, 1., .102), loc='lower left', ncol=2, mode="expand", borderaxespad=0.)plt.subplot(223)plt.plot([1, 2, 3], label="test1")plt.plot([3, 2, 1], label="test...
readme
Python Python文件理解 abc实现多态
19多项式
basic API poly1d(c_or_r[, r, variable]) A one-dimensional polynomial class. polyval(p, x) Evaluate a polynomial at specific values. poly(seq_of_zeros) Find the coefficients of a polynomial with the given sequence of roots. roots(p) Return the roots of a polynomial with coefficients given in p. filter polyfit(x, y, deg[, rcond, full, w, cov]) Least squares polynomial fit. calculus polyder(p[, m]) Return the derivative of the specified order of a polynomial. polyint(p[, m, ...
12ndimage
ndimage用途SciPy的ndimage子模块专用于图像处理。这里,ndimage表示一个n维图像。图像处理中一些最常见的任务如下: 输入/输出/显示图像 基本操作:裁剪,翻转,旋转等图像过滤 去噪,锐化等图像分割 标记对应于不同对象的像素 分类 特征提取 注册/配准 示例1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374# 导入图像from scipy import miscf = misc.face()misc.imsave('face.png', f) # uses the Image module (PIL)import matplotlib.pyplot as pltplt.imshow(f)plt.show()# 基本信息from scipy import miscf = misc.f...
13io
IO loadmat加载一个MATLAB文件 savemat保存为一个MATLAB文件 whosmat列出MATLAB文件中的变量 12345678910import scipy.io as sioimport numpy as np#Save a mat filevect = np.arange(10)sio.savemat('array.mat', {'vect':vect})#Now Load the Filemat_file_content = sio.loadmat('array.mat')print (mat_file_content)
14cluster
聚类cluster.vqProvides routines for k-means clustering, generating code books from k-means models and quantizing vectors by comparing them with centroids in a code book. function introduction whiten(obs[, check_finite]) Normalize a group of observations on a per feature basis.每行元素除以该行的标准差。 vq(obs, code_book[, check_finite]) Assign codes from a code book to observations. kmeans(obs, k_or_guess[, iter, thresh, …]) Performs k-means on a set of observation vectors forming k clusters. km...
11stats
统计函数 实现概率论和数理统计相关的功能














