...
# basename is actually set to "circle" ("arc" is commented out) in that example.
# this saves the figure to "circle_residu2.png" or "circle_residu1.png"
p.savefig('%s_residu%d.png' % (basename, 2 if residu2 else 1))
In MATLAB®, 0:5 can be used as both a range literal and a 'slice' index (inside parentheses); however, in Python, constructs like 0:5 can only be used as a slice index (inside square brackets).
r_
是numpy魔法:http://docs.scipy.org/doc/numpy/reference/generated/numpy.r_.htmlbasename
稍后用于生成文件名:根据NumPy for Matlab Users page,
r_
是一个创建的对象,它允许使用类似Matlab的符号创建数字范围。 i、 e有关^{cd1>}如何工作的更多信息,请查看the docs。在
相关问题 更多 >
编程相关推荐