MCPcopy Index your code
hub / github.com/plotly/plotly.py / crawl_ax

Method crawl_ax

plotly/matplotlylib/mplexporter/exporter.py:127–156  ·  view source on GitHub ↗

Crawl the axes and process all elements within

(self, ax)

Source from the content-addressed store, hash-verified

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 """

Callers 1

crawl_figMethod · 0.95

Calls 8

draw_lineMethod · 0.95
draw_textMethod · 0.95
draw_patchMethod · 0.95
draw_collectionMethod · 0.95
draw_imageMethod · 0.95
crawl_legendMethod · 0.95
draw_axesMethod · 0.80
draw_legendMethod · 0.80

Tested by

no test coverage detected