Matplotlib: clearing a plot, when to use CLA (), CLF () or close ()? matplotlib offers three Functions:cla () # Clea R 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 with each function and what exactly does it do? they all do different things, since Matplotlib uses a hi Erarchical order in which a figure window contains a figure which may consist of many axes. The three commands you mention therefore does 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 of current figure with all its axes, but leaves the window opened, such that it is reused for other plots.close () closes a window, which'll be is the current window and if not specified OT Herwise. Which functions suits you the best depends thus on your use-case. The Close () function furthermore allows one to specify which window should be closed. The argument can either is a number or name given to a window when it is created using figure (number_or_name) or it can B E a figure instance fig obtained, i.e., Usingfig = figure (). If no argument is given to close (), the currently active window would be closed. Furthermore, there is the syntax close ("All"), which closes all figures. http://www.ibm.com/developerworks/ Cn/linux/l-matplotlib/index.html There are a lot of things to learn here too http://www.w3school.com.cn/xmldom/dom_element.asp In fact, no matter what the language, the structure and functions of XML are these, next time you don't have to go around. Alas, the previous use of Java, is also the old run here to find, Python and here, next time remember the point ah, a long memory.
Python matplotlib drawing