10 examples of 'matplotlib clear plot' in Python

Every line of 'matplotlib clear plot' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your Python code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
this disclaimer
113def clear_plot(self):
114 self.scene.mlab.clf(figure=self.scene.mayavi_scene)
Important

Use secure code every time

Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code

40def clear_figure(self):
41 self.figure.clear()
42 self.SetColor(self.color)
43 self._resizeflag = True
807def clear(self):
808 """Clear the plot.
809
810 Resets all internal state and sets need for redraw.
811
812 """
813 if getattr(self, 'handle', None) is not None:
814 if getattr(self.handle, 'collections', None) is not None:
815 self.clear_collections()
816 else:
817 self.clear_handle()
818 self._need_redraw = True
280def clear_figure(self, axis):
281 axis.clear()
282 axis.grid(True)
69def clear_frame(ax=None):
70 """Remove the frame (ticks and spines) from an axes.
71
72 This differs from turning off the axis (`plt.axis('off')` or
73 `ax.set_axis_off()`) in that only the ticks and spines are removed. Turning
74 off the axis also removes the axes background and axis labels.
75
76 Parameters
77 ----------
78 ax : :class:`~matplotlib.axes.Axes`
79 Axes to modify. If None, use current axes.
80 """
81 ax = ax if ax is not None else plt.gca()
82
83 ax.xaxis.set_ticks([])
84 ax.yaxis.set_ticks([])
85 for spine in ax.spines.values():
86 spine.set_visible(False)
48def clear_ax(ax):
49 ax.spines['left'].set_visible(False)
50 ax.spines['right'].set_visible(False)
51 ax.spines['top'].set_visible(False)
52 ax.set_yticks([])
27def reset(self):
28 plt.close('all')
29 plt.rcdefaults()
796def clear_ax(self, silent=True):
797 """Clear the main axe."""
798 self.ax0.clear()
799 self.xticklabels = []
800 self.notes = []
801 if not silent:
802 self.sig_fig_changed.emit(self.figure)
629@DrawAfter
630def Clear(self):
631 """ Clear()
632
633 Clear the figure, removing all wibjects inside it and clearing all
634 callbacks.
635
636 """
637 # remove children
638 while self._children:
639 child = self._children.pop()
640 if hasattr(child, 'Destroy'):
641 child.Destroy()
642 # remove callbacks
643 for fieldName in self.__dict__:
644 if fieldName.startswith('_event'):
645 event = self.__dict__[fieldName]
646 if hasattr(event,'Unbind'):
647 event.Unbind()
648 # Restore some event bindings
649 self.eventPosition.Bind(self._OnPositionChange)
290def ClearFigure(self):
291 """ Clear all previously drawn apodization windows """
292 self.axes.cla()
293 self.OnPaint(-1)

Related snippets