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

Function include

lib/matplotlib/tests/test_backend_svg.py:278–300  ·  view source on GitHub ↗
(gid, obj)

Source from the content-addressed store, hash-verified

276 buf = fd.getvalue().decode()
277
278 def include(gid, obj):
279 # we need to exclude certain objects which will not appear in the svg
280 if isinstance(obj, OffsetBox):
281 return False
282 if isinstance(obj, Text):
283 if obj.get_text() == "":
284 return False
285 elif obj.axes is None:
286 return False
287 if isinstance(obj, plt.Line2D):
288 xdata, ydata = obj.get_data()
289 if len(xdata) == len(ydata) == 1:
290 return False
291 elif not hasattr(obj, "axes") or obj.axes is None:
292 return False
293 if isinstance(obj, Tick):
294 loc = obj.get_loc()
295 if loc == 0:
296 return False
297 vi = obj.get_view_interval()
298 if loc < min(vi) or loc > max(vi):
299 return False
300 return True
301
302 for gid, obj in gdic.items():
303 if include(gid, obj):

Callers 1

test_gidFunction · 0.85

Calls 4

get_locMethod · 0.80
get_textMethod · 0.45
get_dataMethod · 0.45
get_view_intervalMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…