Annotate the point *xy* with text *text*. In the simplest form, the text is placed at *xy*. Optionally, the text can be displayed in another position *xytext*. An arrow pointing from the text to the annotated point *xy* can then be added by defining *arrowp
(self, text, xy,
xytext=None,
xycoords='data',
textcoords=None,
arrowprops=None,
annotation_clip=None,
**kwargs)
| 1866 | return f"Annotation({self.xy[0]:g}, {self.xy[1]:g}, {self._text!r})" |
| 1867 | |
| 1868 | def __init__(self, text, xy, |
| 1869 | xytext=None, |
| 1870 | xycoords='data', |
| 1871 | textcoords=None, |
| 1872 | arrowprops=None, |
| 1873 | annotation_clip=None, |
| 1874 | **kwargs): |
| 1875 | """ |
| 1876 | Annotate the point *xy* with text *text*. |
| 1877 | |
| 1878 | In the simplest form, the text is placed at *xy*. |
| 1879 | |
| 1880 | Optionally, the text can be displayed in another position *xytext*. |
| 1881 | An arrow pointing from the text to the annotated point *xy* can then |
| 1882 | be added by defining *arrowprops*. |
| 1883 | |
| 1884 | Parameters |
| 1885 | ---------- |
| 1886 | text : str |
| 1887 | The text of the annotation. |
| 1888 | |
| 1889 | xy : (float, float) |
| 1890 | The point *(x, y)* to annotate. The coordinate system is determined |
| 1891 | by *xycoords*. |
| 1892 | |
| 1893 | xytext : (float, float), default: *xy* |
| 1894 | The position *(x, y)* to place the text at. The coordinate system |
| 1895 | is determined by *textcoords*. |
| 1896 | |
| 1897 | xycoords : single or two-tuple of str or `.Artist` or `.Transform` or \ |
| 1898 | callable, default: 'data' |
| 1899 | |
| 1900 | The coordinate system that *xy* is given in. The following types |
| 1901 | of values are supported: |
| 1902 | |
| 1903 | - One of the following strings: |
| 1904 | |
| 1905 | ==================== ============================================ |
| 1906 | Value Description |
| 1907 | ==================== ============================================ |
| 1908 | 'figure points' Points from the lower left of the figure |
| 1909 | 'figure pixels' Pixels from the lower left of the figure |
| 1910 | 'figure fraction' Fraction of figure from lower left |
| 1911 | 'subfigure points' Points from the lower left of the subfigure |
| 1912 | 'subfigure pixels' Pixels from the lower left of the subfigure |
| 1913 | 'subfigure fraction' Fraction of subfigure from lower left |
| 1914 | 'axes points' Points from lower left corner of the Axes |
| 1915 | 'axes pixels' Pixels from lower left corner of the Axes |
| 1916 | 'axes fraction' Fraction of Axes from lower left |
| 1917 | 'data' Use the coordinate system of the object |
| 1918 | being annotated (default) |
| 1919 | 'polar' *(theta, r)* if not native 'data' |
| 1920 | coordinates |
| 1921 | ==================== ============================================ |
| 1922 | |
| 1923 | Note that 'subfigure pixels' and 'figure pixels' are the same |
| 1924 | for the parent figure, so users who want code that is usable in |
| 1925 | a subfigure can use 'subfigure pixels'. |
nothing calls this directly
no test coverage detected