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

Method text

lib/mpl_toolkits/mplot3d/axes3d.py:2158–2195  ·  view source on GitHub ↗

Add the text *s* to the 3D Axes at location *x*, *y*, *z* in data coordinates. Parameters ---------- x, y, z : float The position to place the text. s : str The text. zdir : {'x', 'y', 'z', 3-tuple}, optional The d

(self, x, y, z, s, zdir=None, *, axlim_clip=False, **kwargs)

Source from the content-addressed store, hash-verified

2156 return upper, lower
2157
2158 def text(self, x, y, z, s, zdir=None, *, axlim_clip=False, **kwargs):
2159 """
2160 Add the text *s* to the 3D Axes at location *x*, *y*, *z* in data coordinates.
2161
2162 Parameters
2163 ----------
2164 x, y, z : float
2165 The position to place the text.
2166 s : str
2167 The text.
2168 zdir : {'x', 'y', 'z', 3-tuple}, optional
2169 The direction to be used as the z-direction. Default: 'z'.
2170 See `.get_dir_vector` for a description of the values.
2171 axlim_clip : bool, default: False
2172 Whether to hide text that is outside the axes view limits.
2173
2174 .. versionadded:: 3.10
2175 **kwargs
2176 Other arguments are forwarded to `matplotlib.axes.Axes.text`.
2177
2178 Returns
2179 -------
2180 `.Text3D`
2181 The created `.Text3D` instance.
2182 """
2183 if 'rotation' in kwargs:
2184 _api.warn_external(
2185 "The `rotation` parameter has not yet been implemented "
2186 "and is currently ignored."
2187 )
2188 if 'rotation_mode' in kwargs:
2189 _api.warn_external(
2190 "The `rotation_mode` parameter has not yet been implemented "
2191 "and is currently ignored."
2192 )
2193 text = super().text(x, y, s, **kwargs)
2194 art3d.text_2d_to_3d(text, z, zdir, axlim_clip)
2195 return text
2196
2197 text3D = text
2198 text2D = Axes.text

Callers 9

test_tight_layout_textFunction · 0.45
test_text3dFunction · 0.45
test_text3d_modificationFunction · 0.45
_test_proj_draw_axesFunction · 0.45
test_proj_axes_cubeFunction · 0.45
test_axlim_clipFunction · 0.45
test_scale3d_artists_logFunction · 0.45

Calls

no outgoing calls

Tested by 9

test_tight_layout_textFunction · 0.36
test_text3dFunction · 0.36
test_text3d_modificationFunction · 0.36
_test_proj_draw_axesFunction · 0.36
test_proj_axes_cubeFunction · 0.36
test_axlim_clipFunction · 0.36
test_scale3d_artists_logFunction · 0.36