Commit 1ae4682d authored by Yori 'AGy' Fournier's avatar Yori 'AGy' Fournier
Browse files

Seems up to date with myplotlib-v3 except the design module...

parent 4dbd6795
......@@ -3,10 +3,14 @@ from ..myplotlib import MyAxes
from .. import np
# CLASS AxActivity ----------------------------------------------------
# CLASS AxMaxResults --------------------------------------------------
class AxMaxResults(MyAxes):
# FORMATTING --------------------------------------------------------
# DECLARE KEYWORDS ------------------------------------------------
def declareKeywords(self):
self.keywords = {'yRange': None}
# FORMATTING ------------------------------------------------------
def formatRawData(self, rawdata):
# Get the data from the rawData
......@@ -21,8 +25,7 @@ class AxMaxResults(MyAxes):
nbrRuns = len(runName)
xdata = range(0, nbrRuns)
# SET THE FORMATTED DATA -------------------------------------------
# SET THE FORMATTED DATA --------------------------------------
self.data = {'xdata' : xdata,
'ydata' : maxResult,
'nbrRuns': nbrRuns,
......@@ -30,11 +33,11 @@ class AxMaxResults(MyAxes):
return(True)
# PLOTTTING ----------------------------------------------------------
# PLOTTTING -------------------------------------------------------
def plotting(self):
# Get some keywords
yRange = self.fig.keywords.get('yrange', None)
yRange = self.keywords.get('yRange', None)
# xlabel, ylabel
xlabel = r"runs"
......
......@@ -3,10 +3,17 @@ from ..myplotlib import MyAxes
from .. import np
# CLASS AxActivity ----------------------------------------------------
# CLASS AxParameterSpace ----------------------------------------------
class AxParameterSpace(MyAxes):
# FORMATTING --------------------------------------------------------
# DECLARE KEYWORDS ------------------------------------------------
def declareKeywords(self):
self.keywords = {'xRange': None,
'yRange': None}
return(True)
# FORMATTING ------------------------------------------------------
def formatRawData(self, rawdata):
# Get the data from the rawData
......@@ -15,18 +22,18 @@ class AxParameterSpace(MyAxes):
xdata = xdata_tmp
ydata = ydata_tmp
minx = min(xdata)
maxx = max(xdata)
miny = min(ydata)
maxy = max(ydata)
dx = 0.1 * (maxx - minx)
dy = 0.1 * (maxy - miny)
D_XRANGE = [minx-dx, maxx+dx]
D_YRANGE = [miny-dy, maxy+dy]
# SET THE FORMATTED DATA -------------------------------------------
# SET THE FORMATTED DATA --------------------------------------
self.data = {'xdata' : xdata,
'ydata' : ydata,
'dxrange': D_XRANGE,
......@@ -34,12 +41,12 @@ class AxParameterSpace(MyAxes):
return(True)
# PLOTTTING ----------------------------------------------------------
# PLOTTTING -------------------------------------------------------
def plotting(self):
# Get some keywords
xRange = self.fig.keywords.get('xRange', self.data['dxrange'])
yRange = self.fig.keywords.get('yRange', self.data['dyrange'])
xRange = self.keywords.get('xRange', self.data['dxrange'])
yRange = self.keywords.get('yRange', self.data['dyrange'])
# xlabel, ylabel
xlabel = r"${\rm input1}$"
......
......@@ -3,28 +3,36 @@ from ..myplotlib import MyAxes
from .. import np
# CLASS AxActivity ----------------------------------------------------
# CLASS AxResults -----------------------------------------------------
class AxResults(MyAxes):
# FORMATTING --------------------------------------------------------
# DECLARE KEYWORDS ------------------------------------------------
def declareKeywords(self):
self.keywords = {'xRange': None,
'yRange': None,
'zRange': None}
return(True)
# FORMATTING ------------------------------------------------------
def formatRawData(self, rawdata):
# Get the data from the rawData
zdata_tmp = rawdata.data['results']
zdata = zdata_tmp
# SET THE FORMATTED DATA -------------------------------------------
# SET THE FORMATTED DATA --------------------------------------
self.data = {'zdata' : zdata}
return(True)
# PLOTTTING ----------------------------------------------------------
# PLOTTTING -------------------------------------------------------
def plotting(self):
# Get some keywords
xRange = self.fig.keywords.get('xrange', None)
yRange = self.fig.keywords.get('yrange', None)
zRange = self.fig.keywords.get('zrange', None)
xRange = self.keywords.get('xRange', None)
yRange = self.keywords.get('yRange', None)
zRange = self.keywords.get('zRange', None)
# xlabel, ylabel
xlabel = r"${\rm x}~[{\rm m}]$"
......@@ -50,6 +58,6 @@ class AxResults(MyAxes):
self.set_xlim(xRange)
if(yRange is not None):
self.set_xlim(yRange)
self.set_ylim(yRange)
return(True)
......@@ -3,10 +3,16 @@ from ..myplotlib import MyAxes
from .. import np
# CLASS AxActivity ----------------------------------------------------
# CLASS AxTemplate ----------------------------------------------------
class AxTemplate(MyAxes):
# FORMATTING --------------------------------------------------------
# DECLARE KEYWORDS ------------------------------------------------
def declareKeywords(self):
self.keywords = {'xRange': None,
'yRange': None,
'logy': False}
# FORMATTING ------------------------------------------------------
def formatRawData(self, rawdata):
# Get the data from the rawData
......@@ -21,19 +27,19 @@ class AxTemplate(MyAxes):
xdata = xdata_tmp
ydata = ydata_tmp * parameter
# SET THE FORMATTED DATA -------------------------------------------
# SET THE FORMATTED DATA --------------------------------------
self.data = {'xdata' : xdata,
'ydata' : ydata}
return(True)
# PLOTTTING ----------------------------------------------------------
# PLOTTTING -------------------------------------------------------
def plotting(self):
# Get some keywords
xRange = self.fig.keywords.get('xrange', None)
yRange = self.fig.keywords.get('yrange', None)
logy = self.fig.keywords.get('logy', None)
xRange = self.keywords.get('xRange', None)
yRange = self.keywords.get('yRange', None)
logy = self.keywords.get('logy', False)
# MORE KEYWORDS? Go ON ...
# xlabel, ylabel
......
......@@ -12,6 +12,6 @@ mymodule = __import__(modulename)
# BEGINING OF THE SCRIPT -----------------------------------------------
run = mymodule.readRun(cwd + "/" + modulename + "/data/serie2/run1.txt")
fig = mymodule.FigOneAxes3D((run,), mymodule.AxResults)
fig = mymodule.FigOneAxes(mymodule.AxResults, (run,))
fig.print2file(cwd + "/" + modulename + "/img/serie2_run1_results.eps")
......@@ -8,7 +8,7 @@ from .. import AxResults
from .. import AxMaxResults
from .. import AxParameterSpace
from .. import FigOneAxes2D, FigOneAxes3D
from .. import FigOneAxes
_MYMODULE = __name__.split('.')[0]
......@@ -50,7 +50,7 @@ def test100(debug):
run = readRun(_MYMODULE + "/test/data/serie4test/run4test.txt")
fig = FigOneAxes3D((run,), AxResults, debug=debug)
fig = FigOneAxes(AxResults, (run,), debug=debug)
status = fig.plot()
......@@ -67,7 +67,7 @@ def test101(debug):
serie = readSerie(_MYMODULE + "/test/data/serie4test/serie4test.txt")
fig = FigOneAxes2D((serie,), AxMaxResults, debug=debug)
fig = FigOneAxes(AxMaxResults, (serie,), debug=debug)
status = fig.plot()
......@@ -84,7 +84,7 @@ def test102(debug):
serie = readSerie(_MYMODULE + "/test/data/serie4test/serie4test.txt")
fig = FigOneAxes2D((serie,), AxParameterSpace, debug=debug)
fig = FigOneAxes(AxParameterSpace, (serie,), debug=debug)
status = fig.plot()
......
Markdown is supported
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