Commit 3d6292d6 authored by Philipp Gast's avatar Philipp Gast
Browse files

fixed bug were set_rawdata() is called to late. added some keywords in test to see if update works.

parent d3ac4d81
......@@ -108,7 +108,7 @@ class MyFig_base(Figure):
self.aliases={}
# initialise the rawdata
self.rawdata = rawdata
self.set_rawdata(rawdata)
# DEBUG --------------------------------------------------------------
......@@ -270,7 +270,7 @@ class MyFig(MyFig_base):
# SET RAW DATA -----------------------------------------------------
def set_rawdata(self, rawdata):
print("was in setrawdata")
from collections import Iterable
from itertools import repeat
......@@ -296,7 +296,7 @@ class MyFig(MyFig_base):
# FORMAT RAW DATA --------------------------------------------------
def formatRawData(self):
print("now in formatawdata")
for ax, rawdata in zip(self.get_axes(), self.rawdata):
status = False
......
......@@ -45,8 +45,8 @@
from .. import SEVR, DBUG, INFO
from .. import MyAxes
D_XRANGE = [-1, 1]
D_YRANGE = [-2, 2]
D_XRANGE = None
D_YRANGE = None
# Class MyAxes Overwriting Matplotlib.figure.Axes
class AxTest1(MyAxes):
......@@ -58,18 +58,6 @@ class AxTest1(MyAxes):
return(True)
# PLOTTING -----------------------------------------------------------
# the plotting function (need to be overwrite from child
def plotting(self):
try:
self.plot(self.data['xdata'], self.data['ydata'])
except KeyError:
print(SEVR + 'The formatting of the data was apparently wrong. --> EXIT')
return(False)
return(True)
# FORMATTING ---------------------------------------------------------
def formatRawData(self, rawdata):
......@@ -78,7 +66,7 @@ class AxTest1(MyAxes):
try:
self.data = {'xdata': [rawdata.data[0], rawdata.data[1]],
'ydata': [rawdata.data[2], rawdata.data[3]]}
except (TypeError, KeyError):
except (TypeError, KeyError,IndexError):
print(SEVR + 'The Raw Data could not be formatted --> EXIT')
return(False)
......@@ -86,3 +74,22 @@ class AxTest1(MyAxes):
print(DBUG + 'I formatted the raw data!')
return(True)
# PLOTTING -----------------------------------------------------------
# the plotting function (need to be overwrite from child
def plotting(self):
xRange=self.keywords.get('xRange')
yRange=self.keywords.get('yRange')
try:
self.plot(self.data['xdata'], self.data['ydata'])
except KeyError:
print(SEVR + 'The formatting of the data was apparently wrong. --> EXIT')
return(False)
if (xRange): self.set_xlim(xRange)
if (yRange): self.set_ylim(yRange)
return(True)
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