plot circle on unequal axes with pyplot

前端 未结 3 438
一个人的身影
一个人的身影 2021-01-11 17:17

I would like to plot a circle on an auto-scaled pyplot-generated graphic. When I run

ax.get_aspect()

hoping for a value with which I could

3条回答
  •  庸人自扰
    2021-01-11 18:06

    Building on @user3208430, if you want the circle to always appear at the same place in the axes (regardless of data ranges), you can position it using axes coordinates via transform:

    ax.plot(.94, .94, 'ro', fillstyle='full', markersize=5, transform=ax.transAxes)
    

    Where x and y are between [0 and 1]. This example places the marker in the upper right-hand corner of the axes.

提交回复
热议问题