figure.add_subplot() vs pyplot.subplot()

前端 未结 2 1416
天命终不由人
天命终不由人 2020-12-30 04:51

What is the difference between add_subplot() and subplot()? They both seem to add a subplot if one isn\'t there. I looked at the documentation but

2条回答
  •  一向
    一向 (楼主)
    2020-12-30 05:43

    pyplot.subplot is wrapper of Figure.add_subplot with a difference in behavior. Creating a subplot with pyplot.subplot will delete any pre-existing subplot that overlaps with it beyond sharing a boundary. If you do not want this behavior, use the Figure.add_subplot method or the pyplot.axes function instead. More

提交回复
热议问题