(self)
| 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 | |
| 122 | if __name__ == '__main__': |
nothing calls this directly
no test coverage detected