vertical & horizontal lines in matplotlib

后端 未结 3 1378
有刺的猬
有刺的猬 2020-11-29 21:27

I do not quite understand why I am unable to create horizontal and vertical lines at specified limits. I would like to bound the data by this box. However, the sides do not

3条回答
  •  甜味超标
    2020-11-29 22:03

    If you want to add a bounding box, use a rectangle:

    ax = plt.gca()
    r = matplotlib.patches.Rectangle((.5, .5), .25, .1, fill=False)
    ax.add_artist(r)
    

    Rectangle doc

提交回复
热议问题