Пример #1
0
    def test_plotprb(self):
        """
        Make a compund path -- in this case two simple polygons, a rectangle
        and a triangle.  Use CLOSEOPOLY and MOVETO for the different parts of
        the compound path
        """
        fig = plt.figure()
        rg = RG(0, 0, SubFrameType("D"))
        prb0 = rg.prb(0)
        prb0().patch.set_facecolor((0.0, 0.0, 1.0, 0.5))
        prb5 = rg.prb(5)
        prb5().patch.set_facecolor((0.0, 0.0, 1.0, 0.5))

        # prb2 = rg.deriveLocaizedVrbMappedPrb([2])[0]
        # prb2.patch.set_facecolor((0.0,0.0,1.0,0.5))
        # prb3 = rg.deriveDistributedVrbMappedPrb(1,[3],1)[0]
        # prb3().patch.set_facecolor((0.0,0.4,1.0,0.5))
        re1 = rg.re(1, 2)
        re1().patch.set_facecolor((1.0, 0.0, 0.0, 0.5))
        re2 = rg.re(5, 6)
        re2().patch.set_facecolor((0.0, 1.0, 0.0, 0.5))
        # ax = fig.add_subplot(1,1,1,xlim=(0, conf.N__symb___DL), ylim = (0, conf.N__sc___RB_DL))
        ax = fig.add_subplot(1, 1, 1)
        ax.add_patch(re1().patch)
        ax.add_patch(re2().patch)
        ax.add_patch(prb0().patch)
        ax.add_patch(prb5().patch)
        # ax.add_patch(prb2.patch)
        # ax.add_patch(prb3().patch)
        ax.add_patch(rg.getResPatchInPrb(5))
        #        ax.dataLim.update_from_data_xy(vertices)
        ax.autoscale_view()
        plt.show()
Пример #2
0
    def test_plotprb(self):
        """
        Make a compund path -- in this case two simple polygons, a rectangle
        and a triangle.  Use CLOSEOPOLY and MOVETO for the different parts of
        the compound path
        """
        frame = cell.add_worksheet("frame0")
        rg00 = RG(0, 0, SubFrameType('D'))

        prb0 = rg00.prb(0)
        prb0().write(frame)
        rg05 = RG(0, 5, SubFrameType('D'))
        prb5 = rg05.prb(5)
        prb5().write(frame)

        #prb2 = rg.deriveLocaizedVrbMappedPrb([2])[0]
        #prb2.patch.set_facecolor((0.0,0.0,1.0,0.5))
        # prb3 = rg.deriveDistributedVrbMappedPrb(1,[3],1)[0]
        # prb3().patch.set_facecolor((0.0,0.4,1.0,0.5))
        re1 = rg00.re(1,2)
        re2 = rg05.re(5,6)
        cell.close()