I am trying to implement a structure which consists of one class called "Problem3Plot" and another one which is called "ProfilePlot". They are working already where they are simply reading in some data and then create a plot from it. Now, I want to lay them out right next to each other; thus, appyling some kind of Component pattern (not that strict).
I am simply assigning new matplotlib.axis to be the old ones. But my axis are empty, thus the data hasn't been plotted somehow.
Here is the code mentioned:
class ProfilePlot(object):
def __init__(self):
# Subplot axes
self.uAxis = plt.subplot2grid((2,1),(0,0))
self.druAxis = plt.subplot2grid((2,1),(1,0))
self.axes = [self.uAxis,self.druAxis]
def plot(self):
self.uAxis.plot(...)
self.druAxis.plot(...)
class Problem3Plot(object):
def plotSetup(self):
self.mainAxis = plt.subplot2grid((1,1),(0,0))
self.mainAxis.plot(...)
class PloblemProfilePlot(object):
def plot(self):
self.problemAxis = ProblemPlotInstance.mainAxis
self.problemUAxis = ProfilePlotInstance.uAxis
self.problemDruAxis = ProfilePlotInstance.druAxis
In PloblemProfilePlot.plot, I am assigning the existing axis to be the ones of the new object but I am getting - as mentioned - only empty graphs.
How do I work around this issue? Thanks!