MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / __init__

Method __init__

lib/matplotlib/backends/backend_wx.py:914–943  ·  view source on GitHub ↗
(self, num, fig, *, canvas_class)

Source from the content-addressed store, hash-verified

912
913class FigureFrameWx(wx.Frame):
914 def __init__(self, num, fig, *, canvas_class):
915 # On non-Windows platform, explicitly set the position - fix
916 # positioning bug on some Linux platforms
917 if wx.Platform == '__WXMSW__':
918 pos = wx.DefaultPosition
919 else:
920 pos = wx.Point(20, 20)
921 super().__init__(parent=None, id=-1, pos=pos)
922 # Frame will be sized later by the Fit method
923 _log.debug("%s - __init__()", type(self))
924 _set_frame_icon(self)
925
926 self.canvas = canvas_class(self, -1, fig)
927 # Auto-attaches itself to self.canvas.manager
928 manager = FigureManagerWx(self.canvas, num, self)
929
930 toolbar = self.canvas.manager.toolbar
931 if toolbar is not None:
932 self.SetToolBar(toolbar)
933
934 # On Windows, canvas sizing must occur after toolbar addition;
935 # otherwise the toolbar further resizes the canvas.
936 w, h = map(math.ceil, fig.bbox.size)
937 self.canvas.SetInitialSize(self.FromDIP(wx.Size(w, h)))
938 self.canvas.SetMinSize(self.FromDIP(wx.Size(2, 2)))
939 self.canvas.SetFocus()
940
941 self.Fit()
942
943 self.Bind(wx.EVT_CLOSE, self._on_close)
944
945 def _on_close(self, event):
946 _log.debug("%s - on_close()", type(self))

Callers

nothing calls this directly

Calls 3

_set_frame_iconFunction · 0.85
FigureManagerWxClass · 0.85
__init__Method · 0.45

Tested by

no test coverage detected