When matplotlib is embedded in PyQt4 how are axes/

2019-08-26 08:32发布

问题:

It's easy with pyplot but apparently pyplot shouldn't be used when embedding. I haven't been able to find any non-pyplot embedding examples where labels are used.

回答1:

Maybe you found this page, too. Maybe this example helps. I have not tested it, thus I cannot say if it works.

Staying with the example from the matplotlib example, the labels in the subplot self.axes can be set using self.axes.set_xlabel(x Label") or self.axes.set_ylabel("y Label").