10 examples of 'python clear figure' in Python

Every line of 'python clear figure' 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
40def clear_figure(self):
41 self.figure.clear()
42 self.SetColor(self.color)
43 self._resizeflag = True
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

290def ClearFigure(self):
291 """ Clear all previously drawn apodization windows """
292 self.axes.cla()
293 self.OnPaint(-1)
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)
62def delete(self):
63 '''
64 Delete the figure
65 '''
66 self.figure.delete()
280def clear_figure(self, axis):
281 axis.clear()
282 axis.grid(True)
1398def clear_canvas(self):
1399 """ Clear data including lines and image from canvas
1400 """
1401 # clear the image for next operation
1402 self.axes.hold(False)
1403
1404 # Clear all lines
1405 self.clear_all_1d_plots()
1406
1407 # clear image
1408 self.axes.cla()
1409 # Try to clear the color bar
1410 if len(self.fig.axes) > 1:
1411 self.fig.delaxes(self.fig.axes[1])
1412 self._colorBar = None
1413 # This clears the space claimed by color bar but destroys sub_plot too.
1414 self.fig.clear()
1415 # Re-create subplot
1416 self.axes = self.fig.add_subplot(111)
1417 self.fig.subplots_adjust(bottom=0.15)
1418
1419 # flush/commit
1420 self._flush()
1421
1422 return
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)
113def clear_plot(self):
114 self.scene.mlab.clf(figure=self.scene.mayavi_scene)
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
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)

Related snippets