예제 #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="")
예제 #2
0
파일: classicfun.py 프로젝트: tschm/chebpy
    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):
예제 #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)
예제 #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")
예제 #5
0
 def test_plot(self):
     plt = import_plt()
     if plt:
         fig, ax = plt.subplots()
         self.f0.plot(ax=ax)