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

Function _get_link_annotation

lib/matplotlib/backends/backend_pdf.py:268–286  ·  view source on GitHub ↗

Create a link annotation object for embedding URLs.

(gc, x, y, width, height, angle=0)

Source from the content-addressed store, hash-verified

266
267
268def _get_link_annotation(gc, x, y, width, height, angle=0):
269 """
270 Create a link annotation object for embedding URLs.
271 """
272 quadpoints, rect = _get_coordinates_of_block(x, y, width, height, angle)
273 link_annotation = {
274 'Type': Name('Annot'),
275 'Subtype': Name('Link'),
276 'Rect': rect,
277 'Border': [0, 0, 0],
278 'A': {
279 'S': Name('URI'),
280 'URI': gc.get_url(),
281 },
282 }
283 if angle % 90:
284 # Add QuadPoints
285 link_annotation['QuadPoints'] = quadpoints
286 return link_annotation
287
288
289# PDF strings are supposed to be able to include any eight-bit data, except

Callers 3

draw_mathtextMethod · 0.85
draw_texMethod · 0.85
draw_textMethod · 0.85

Calls 3

NameClass · 0.85
get_urlMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…