(self, quad=rectangle_points([0.0, 1.0], [0.0, 1.0]), show_axes=False)
Shows the quadrature points on a given quad. The area of the disks around the
        points coincides with their weights.
Shows the quadrature points on a given quad. The area of the disks around the
        points coincides with their weights.
Shows the quadrature points on a given quad . The area of the disks around the points coincides with their weights .
def plot(self, quad=rectangle_points([0.0, 1.0], [0.0, 1.0]), show_axes=False):
        """Shows the quadrature points on a given quad. The area of the disks around the
        points coincides with their weights.
        """
        from matplotlib import pyplot as plt

        def plot_segment(a, b):
            plt.plot((a[0], b[0]), (a[1], b[1]), "-k")

        plot_segment(quad[0][0], quad[1][0])
        plot_segment(quad[1][0], quad[1][1])
        plot_segment(quad[1][1], quad[0][1])
        plot_segment(quad[0][1], quad[0][0])

        if not show_axes:
            plt.gca().set_axis_off()

        transformed_pts = transform(self.points, quad)

        # compute volume by splitting it in two triangles
        vol = get_vol(np.array([quad[0][0], quad[1][0], quad[0][1]])) + get_vol(
            np.array([quad[0][0], quad[0][1], quad[1][1]])
        )
        plot_disks(plt, transformed_pts, self.weights, vol)
        plt.axis("equal")
        plt.xlim(-0.1, 1.1)
        plt.ylim(-0.1, 1.1)
def plot ( self , quad = rectangle_points ( [ 0.0 , 1.0 ] , [ 0.0 , 1.0 ] ) , show_axes = False ) : from matplotlib import pyplot as plt def plot_segment ( a , b ) : plt . plot ( ( a [ 0 ] , b [ 0 ] ) , ( a [ 1 ] , b [ 1 ] ) , "-k" ) plot_segment ( quad [ 0 ] [ 0 ] , quad [ 1 ] [ 0 ] ) plot_segment ( quad [ 1 ] [ 0 ] , quad [ 1 ] [ 1 ] ) plot_segment ( quad [ 1 ] [ 1 ] , quad [ 0 ] [ 1 ] ) plot_segment ( quad [ 0 ] [ 1 ] , quad [ 0 ] [ 0 ] ) if not show_axes : plt . gca ( ) . set_axis_off ( ) transformed_pts = transform ( self . points , quad ) # compute volume by splitting it in two triangles vol = get_vol ( np . array ( [ quad [ 0 ] [ 0 ] , quad [ 1 ] [ 0 ] , quad [ 0 ] [ 1 ] ] ) ) + get_vol ( np . array ( [ quad [ 0 ] [ 0 ] , quad [ 0 ] [ 1 ] , quad [ 1 ] [ 1 ] ] ) ) plot_disks ( plt , transformed_pts , self . weights , vol ) plt . axis ( "equal" ) plt . xlim ( - 0.1 , 1.1 ) plt . ylim ( - 0.1 , 1.1 )