python matplotlib绘图

 
Matplotlib offers three functions:cla() # Clear axis clf() # Clear figure close() # Close a figure windowThe documentation doesn't offer a lot of insight into what the difference between these functions is. When should I use each function and what exactly does it do?
 
They all do different things, since matplotlib uses a hierarchical order in which a figure window contains a figure which may consist of many axes. The three commands you mention therefore do the following:cla() clears an axis, i.e. the currently active axis in the current figure. It leaves the other axes untouched.clf() clears the entire current figure with all its axes, but leaves the window opened, such that it may be reused for other plots.close() closes a window, which will be the current window, if not specified otherwise.Which functions suits you best depends thus on your use-case.The close() function furthermore allows one to specify which window should be closed. The argument can either be a number or name given to a window when it was created using figure(number_or_name) or it can be a figure instance fig obtained, i.e., usingfig = figure(). If no argument is given to close(), the currently active window will be closed. Furthermore, there is the syntax close('all'), which closes all figures.
 
 
http://www.ibm.com/developerworks/cn/linux/l-matplotlib/index.html
这里也有不少可以学习的东西
 
 
http://www.w3school.com.cn/xmldom/dom_element.asp
 
其实无论什么语言,xml的结构和函数就这些,下次就不用绕了。唉,以前用java时,也是老跑这里找,python又到这里,下次就记住点啊,长点记性。
转载请注明出处,谢谢。
原文地址:https://www.cnblogs.com/jianyingzhou/p/4629840.html