Draw the bubble plot. Parameters ---------- ax : matplotlib.axes.Axes labels : list Labels of the bubbles. colors : list Colors of the bubbles.
(self, ax, labels, colors)
| 135 | self.step_dist = self.step_dist / 2 |
| 136 | |
| 137 | def plot(self, ax, labels, colors): |
| 138 | """ |
| 139 | Draw the bubble plot. |
| 140 | |
| 141 | Parameters |
| 142 | ---------- |
| 143 | ax : matplotlib.axes.Axes |
| 144 | labels : list |
| 145 | Labels of the bubbles. |
| 146 | colors : list |
| 147 | Colors of the bubbles. |
| 148 | """ |
| 149 | for i in range(len(self.bubbles)): |
| 150 | circ = plt.Circle( |
| 151 | self.bubbles[i, :2], self.bubbles[i, 2], color=colors[i]) |
| 152 | ax.add_patch(circ) |
| 153 | ax.text(*self.bubbles[i, :2], labels[i], |
| 154 | horizontalalignment='center', verticalalignment='center') |
| 155 | |
| 156 | |
| 157 | bubble_chart = BubbleChart(area=browser_market_share['market_share'], |