Crawl the axes and process all elements within
(self, ax)
| 125 | self.crawl_ax(ax) |
| 126 | |
| 127 | def crawl_ax(self, ax): |
| 128 | """Crawl the axes and process all elements within""" |
| 129 | with self.renderer.draw_axes(ax=ax, props=utils.get_axes_properties(ax)): |
| 130 | for line in ax.lines: |
| 131 | self.draw_line(ax, line) |
| 132 | for text in ax.texts: |
| 133 | self.draw_text(ax, text) |
| 134 | for text, ttp in zip( |
| 135 | [ax.xaxis.label, ax.yaxis.label, ax.title], |
| 136 | ["xlabel", "ylabel", "title"], |
| 137 | ): |
| 138 | if hasattr(text, "get_text") and text.get_text(): |
| 139 | self.draw_text(ax, text, force_trans=ax.transAxes, text_type=ttp) |
| 140 | for artist in ax.artists: |
| 141 | # TODO: process other artists |
| 142 | if isinstance(artist, matplotlib.text.Text): |
| 143 | self.draw_text(ax, artist) |
| 144 | for patch in ax.patches: |
| 145 | self.draw_patch(ax, patch) |
| 146 | for collection in ax.collections: |
| 147 | self.draw_collection(ax, collection) |
| 148 | for image in ax.images: |
| 149 | self.draw_image(ax, image) |
| 150 | |
| 151 | legend = ax.get_legend() |
| 152 | if legend is not None: |
| 153 | props = utils.get_legend_properties(ax, legend) |
| 154 | with self.renderer.draw_legend(legend=legend, props=props): |
| 155 | if props["visible"]: |
| 156 | self.crawl_legend(ax, legend) |
| 157 | |
| 158 | def crawl_legend(self, ax, legend): |
| 159 | """ |
no test coverage detected