Commit 1b5474f0 authored by Philipp Gast's avatar Philipp Gast
Browse files

aliases working. Todo: clean up test case again. Make new test

parent 3d6292d6
......@@ -162,6 +162,10 @@ class MyFig_base(Figure):
return(True)
def set_rawdata(self, rawdata) :
self.rawdata = rawdata
return True
# PRINT 2 FILE -------------------------------------------------------
def print2file(self, filename, *args, **kwargs):
......@@ -254,9 +258,15 @@ class MyFig(MyFig_base):
# INITIALIZE -------------------------------------------------------
def _initialize(self, *args, **kwargs):
# set rawdata
self.set_rawdata(self.rawdata)
# add the axes
self.addAxes()
# set aliases to control multiple axes with identical control keywords
self.declareAliases()
# update the attributes and keywords
self.update(**kwargs)
......
......@@ -78,10 +78,22 @@ class FigTest2(MyFig):
# Set the size of the Figure in inch
# (private variable can not be updated)
FIGSIZE = (8., 6.)
def declareAliases(self):
self.aliases = {'xRange_p1': (self.ax1,"xRange"),
'xRange_p2': (self.ax2,"xRange")}
return(True)
def addAxes(self):
ratio = 6. / 8. # height/width of the axes (in inch)
frame = [0.1, 0.1, 0.8, 0.8] # part of the fig that is available
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.ax1=AxTest1(self, ratio, frame1)
self.ax2=AxTest1(self, ratio, frame2)
self.add_axes(AxTest1(self, ratio, frame))
self.add_axes(self.ax1)
self.add_axes(self.ax2)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment