# IMPORT --------------------------------------------------------------- from myplotlib import MyFig from axTest import AxTest class FigTest(MyFig): FIGSIZE = (8., 6.) def addAxes(self): ratio = 6. / 8. # height/width of the axes (in inch) frame1 = [0.1, 0.1, 0.8, 0.8] # part of the fig that is available self.add_axes(AxTest(self, ratio, frame1), "p1") class FigTest2(MyFig): # Fig with two Axes # Set the size of the Figure in inch # (private variable can not be updated) FIGSIZE = (8., 6.) def addAxes(self): ratio = 6. / 8. # height/width of the axes (in inch) frame1 = [0.1, 0.1, 0.4, 0.8] # part of the fig that is available frame2 = [0.6, 0.1, 0.4, 0.8] # part of the fig that is available self.add_axes(AxTest(self, ratio, frame1),"p1") self.add_axes(AxTest(self, ratio, frame2),"p2") def declareAliases(self): # it is important to not hold additional references to an axes in the figure to avoid memory leaks. use the this function # get the plot added above p1 = self.getAxesByName("p1") p2 = self.getAxesByName("p2") self.aliases = {'xRange_p1': (p1, "xRange"), 'xRange_p2': (p2, "xRange")} return(True)