Пример #1
0
    def plot(self, axes):
        """Plots the axes object

        Parameters
        ----------
        axes : object
            The matplotlib axes object.
        """
        assert_axes_dimension(axes, 3)
        o = self.origin
        xyz = self.vectors
        axes.plot([o[0, 0], o[0, 0] + xyz[0, 0]],
                  [o[0, 1], o[0, 1] + xyz[0, 1]],
                  [o[0, 2], o[0, 2] + xyz[0, 2]],
                  '{0}-'.format(self.colors[0]),
                  linewidth=3)
        axes.plot([o[0, 0], o[0, 0] + xyz[1, 0]],
                  [o[0, 1], o[0, 1] + xyz[1, 1]],
                  [o[0, 2], o[0, 2] + xyz[1, 2]],
                  '{0}-'.format(self.colors[1]),
                  linewidth=3)
        axes.plot([o[0, 0], o[0, 0] + xyz[2, 0]],
                  [o[0, 1], o[0, 1] + xyz[2, 1]],
                  [o[0, 2], o[0, 2] + xyz[2, 2]],
                  '{0}-'.format(self.colors[2]),
                  linewidth=3)
Пример #2
0
 def plot(self, axes):
     assert_axes_dimension(axes, 3)
     rec = [[self.corners[index] for index in face] for face in self.faces]
     rec_coll = Poly3DCollection(rec)
     rec_coll.set_facecolors([(1.0, 0.0, 0.0) for face in self.faces])
     rec_coll.set_alpha(0.2)
     axes.add_collection3d(rec_coll)
Пример #3
0
 def plot(self, axes):
     assert_axes_dimension(axes, 3)
     xmin, ymin, zmin = argmin(self.points, axis=0)
     xmax, ymax, zmax = argmax(self.points, axis=0)
     xspan = self.points[xmax, 0] - self.points[xmin, 0]
     yspan = self.points[ymax, 1] - self.points[ymin, 1]
     zspan = self.points[zmax, 2] - self.points[zmin, 2]
     span = max(xspan, yspan, zspan)
     axes.plot([self.points[xmin, 0]], [self.points[ymin, 1]],
               [self.points[zmin, 2]], 'w')
     axes.plot([self.points[xmin, 0] + span], [self.points[ymin, 1] + span],
               [self.points[zmin, 2] + span], 'w')
Пример #4
0
    def plot(self, axes):
        """Plots the axes object

        Parameters
        ----------
        axes : object
            The matplotlib axes object.
        """
        assert_axes_dimension(axes, 2)
        o = self.origin
        xy = self.vectors
        axes.plot([o[0, 0], o[0, 0] + xy[0, 0]], [o[0, 1], o[0, 1] + xy[0, 1]],
                  'r-')
        axes.plot([o[0, 0], o[0, 0] + xy[1, 0]], [o[0, 1], o[0, 1] + xy[1, 1]],
                  'g-')