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

Method __call__

tools/memleak.py:92–119  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

90 self.empty = empty
91
92 def __call__(self):
93 import matplotlib.pyplot as plt
94
95 fig = plt.figure(1)
96
97 if not self.empty:
98 t1 = np.arange(0.0, 2.0, 0.01)
99 y1 = np.sin(2 * np.pi * t1)
100 y2 = np.random.rand(len(t1))
101 X = np.random.rand(50, 50)
102
103 ax = fig.add_subplot(221)
104 ax.plot(t1, y1, '-')
105 ax.plot(t1, y2, 's')
106
107 ax = fig.add_subplot(222)
108 ax.imshow(X)
109
110 ax = fig.add_subplot(223)
111 ax.scatter(np.random.rand(50), np.random.rand(50),
112 s=100 * np.random.rand(50), c=np.random.rand(50))
113
114 ax = fig.add_subplot(224)
115 ax.pcolor(10 * np.random.rand(50, 50))
116
117 fig.savefig(BytesIO(), dpi=75)
118 fig.canvas.flush_events()
119 plt.close(1)
120
121
122if __name__ == '__main__':

Callers

nothing calls this directly

Calls 9

figureMethod · 0.80
add_subplotMethod · 0.80
imshowMethod · 0.80
pcolorMethod · 0.80
plotMethod · 0.45
scatterMethod · 0.45
savefigMethod · 0.45
flush_eventsMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected