Beispiel #1
0
 def test_plot(self):
     plt = import_plt()
     if plt:
         fig, ax = plt.subplots()
         self.f0.plot(ax=ax,
                      color="g",
                      marker="o",
                      markersize=2,
                      linestyle="")
Beispiel #2
0
    def diff(self):
        a, b = self.support
        onefun = 2. / (b - a) * self.onefun.diff()
        return self.__class__(onefun, self.interval)

    def sum(self):
        a, b = self.support
        return .5 * (b - a) * self.onefun.sum()


# ----------
#  plotting
# ----------

plt = import_plt()
if plt:

    def plot(self, ax=None, **kwargs):
        return plotfun(self, self.support, ax=ax, **kwargs)

    setattr(Classicfun, 'plot', plot)

# ----------------------------------------------------------------
#  methods that execute the corresponding onefun method as is
# ----------------------------------------------------------------

methods_onefun_other = ('values', 'plotcoeffs')


def addUtility(methodname):
Beispiel #3
0
 def test_plotcoeffs(self):
     plt = import_plt()
     if plt:
         for fun in [self.f1, self.f2, self.f3]:
             fig, ax = plt.subplots()
             fun.plotcoeffs(ax=ax)
Beispiel #4
0
 def test_plotcoeffs(self):
     plt = import_plt()
     if plt:
         fig, ax = plt.subplots()
         self.f0.plotcoeffs(ax=ax)
         self.f1.plotcoeffs(ax=ax, color="r")
Beispiel #5
0
 def test_plot(self):
     plt = import_plt()
     if plt:
         fig, ax = plt.subplots()
         self.f0.plot(ax=ax)