Matplotlib: using a figure object to initialize a plot

前端 未结 2 1294
后悔当初
后悔当初 2020-12-09 00:57

I am building a class of plot tools for a specific experiment. I currently have two plot methods, a static plot using imshow(), and a \"movie\" format also using imshow() .<

2条回答
  •  不知归路
    2020-12-09 01:05

    To show a plot you'll want to use fig.canvas.draw() where fig is an instance of the Figure class. fig.canvas.draw() is the API version of the interactive shell (read: pylab) function draw()

    If you need to get the Axes or Figure from an AxesImage object you can call either im.get_axes() or im.get_figure(), respectively.

    As far as writing "good" object-oriented code the user interface examples might be good place to start.

提交回复
热议问题