Ctrl+K
Logo image Logo image
  • Plot types
  • Examples
  • Tutorials
  • Reference
  • User guide
  • Develop
  • Release notes
  • Plot types
  • Examples
  • Tutorials
  • Reference
  • User guide
  • Develop
  • Release notes

Section Navigation

  • Lines, bars and markers
  • Images, contours and fields
  • Subplots, axes and figures
  • Statistics
  • Pie and polar charts
  • Text, labels and annotations
  • pyplot
  • Color
  • Shapes and collections
  • Style sheets
  • axes_grid1
  • axisartist
  • Showcase
  • Animation
  • Event handling
  • Miscellaneous
  • 3D plotting
  • Scales
  • Specialty Plots
  • Spines
  • Ticks
  • Units
  • Embedding Matplotlib in graphical user interfaces
  • Userdemo
    • Anchored Box04
    • Annotate Explain
    • Annotate Simple01
    • Annotate Simple02
    • Annotate Simple03
    • Annotate Simple04
    • Annotate Simple Coord01
    • Annotate Simple Coord02
    • Annotate Simple Coord03
    • Annotate Text Arrow
    • Connect Simple01
    • Connection styles for annotations
    • Custom box styles
    • subplot2grid demo
    • GridSpec demo
    • Nested GridSpecs
    • PGF fonts
    • PGF preamble
    • PGF texsystem
    • Simple Annotate01
    • Simple Legend01
    • Simple Legend02
  • Widgets

Note

Click here to download the full example code

Annotate Simple01#

annotate simple01
import matplotlib.pyplot as plt


fig, ax = plt.subplots(figsize=(3, 3))

ax.annotate("",
            xy=(0.2, 0.2), xycoords='data',
            xytext=(0.8, 0.8), textcoords='data',
            arrowprops=dict(arrowstyle="->",
                            connectionstyle="arc3"),
            )

plt.show()

Download Python source code: annotate_simple01.py

Download Jupyter notebook: annotate_simple01.ipynb

Gallery generated by Sphinx-Gallery

© Copyright 2002–2012 John Hunter, Darren Dale, Eric Firing, Michael Droettboom and the Matplotlib development team; 2012–2022 The Matplotlib development team.

Created using Sphinx 5.2.3.