Plot the principal coordinates.
977313
def plot_coordinates(self, X, ax=None, figsize=(6, 6), x_component=0, y_component=1,
                                   show_row_labels=True, show_col_labels=True, **kwargs):
        """"""

        utils.validation.check_is_fitted(self, 's_')

        if ax is None:
            fig, ax = plt.subplots(figsize=figsize)

        # Add style
        ax = plot.stylize_axis(ax)

        # Get labels and names
        row_label, row_names, col_label, col_names = util.make_labels_and_names(X)

        # Plot row principal coordinates
        row_coords = self.row_coordinates(X)
        ax.scatter(
            row_coords[x_component],
            row_coords[y_component],
            **kwargs,
            label=row_label
        )

        # Plot column principal coordinates
        col_coords = self.column_coordinates(X)
        ax.scatter(
            col_coords[x_component],
            col_coords[y_component],
            **kwargs,
            label=col_label
        )

        # Add row labels
        if show_row_labels:
            x = row_coords[x_component]
            y = row_coords[y_component]
            for i, label in enumerate(row_names):
                ax.annotate(label, (x[i], y[i]))

        # Add column labels
        if show_col_labels:
            x = col_coords[x_component]
            y = col_coords[y_component]
            for i, label in enumerate(col_names):
                ax.annotate(label, (x[i], y[i]))

        # Legend
        ax.legend()

        # Text
        ax.set_title('Principal coordinates')
        ei = self.explained_inertia_
        ax.set_xlabel('Component {} ({:.2f}% inertia)'.format(x_component, 100 * ei[x_component]))
        ax.set_ylabel('Component {} ({:.2f}% inertia)'.format(y_component, 100 * ei[y_component]))

        return ax
537131
def principal_axis_system(self):
        
        return ChemicalShielding(np.diag(np.sort(np.linalg.eigvals(self))))
1266916
def plot(self, **kwds):
        """
        plo = self.lx.plot(dist_to_center=3, **kwds)
        plo += self.ly.plot(dist_to_center=3, **kwds)
        plo += self.lz.plot(dist_to_center=3, **kwds)
        plo += self.lx_r.plot(dist_to_center=3, **kwds)
        plo += self.ly_r.plot(dist_to_center=3, **kwds)
        plo += self.lz_r.plot(dist_to_center=3, **kwds)
        return plo
56461
def principal_axis_system(self):
        
        return ElectricFieldGradient(np.diag(np.sort(np.linalg.eigvals(self))))
1149676
def plot_row_coordinates(self, X, ax=None, figsize=(6, 6), x_component=0, y_component=1,
                             labels=None, color_labels=None, ellipse_outline=False,
                             ellipse_fill=True, show_points=True, **kwargs):
        """"""
        utils.validation.check_is_fitted(self, 's_')

        if ax is None:
            fig, ax = plt.subplots(figsize=figsize)

        # Add style
        ax = plot.stylize_axis(ax)

        # Make sure X is a DataFrame
        if not isinstance(X, pd.DataFrame):
            X = pd.DataFrame(X)

        # Retrieve principal coordinates
        coordinates = self.row_coordinates(X)
        x = coordinates[x_component].astype(np.float)
        y = coordinates[y_component].astype(np.float)

        # Plot
        if color_labels is None:
            ax.scatter(x, y, **kwargs)
        else:
            for color_label in sorted(list(set(color_labels))):
                mask = np.array(color_labels) == color_label
                color = ax._get_lines.get_next_color()
                # Plot points
                if show_points:
                    ax.scatter(x[mask], y[mask], color=color, **kwargs, label=color_label)
                # Plot ellipse
                if (ellipse_outline or ellipse_fill):
                    x_mean, y_mean, width, height, angle = plot.build_ellipse(x[mask], y[mask])
                    ax.add_patch(mpl.patches.Ellipse(
                        (x_mean, y_mean),
                        width,
                        height,
                        angle=angle,
                        linewidth=2 if ellipse_outline else 0,
                        color=color,
                        fill=ellipse_fill,
                        alpha=0.2 + (0.3 if not show_points else 0) if ellipse_fill else 1
                    ))

        # Add labels
        if labels is not None:
            for i, label in enumerate(labels):
                ax.annotate(label, (x[i], y[i]))

        # Legend
        ax.legend()

        # Text
        ax.set_title('Row principal coordinates')
        ei = self.explained_inertia_
        ax.set_xlabel('Component {} ({:.2f}% inertia)'.format(x_component, 100 * ei[x_component]))
        ax.set_ylabel('Component {} ({:.2f}% inertia)'.format(y_component, 100 * ei[y_component]))

        return ax
1223799
def plot_line(axes, fname, ltype):
    """"""
    x = np.genfromtxt(fname, unpack=True)
    axes.plot(x[0], x[1], ltype)
813280
def plot(self, x, y, color="black"):
        
        p = Point(x, y)
        p.fill(color)
        p.draw(self)
141946
def _plot(self):
        """"""
        squares = self._squares()
        sq_dimensions = self.add_squares(squares)

        for index, serie in enumerate(self.series):
            current_square = self._current_square(squares, index)
            self.gaugify(serie, squares, sq_dimensions, current_square)
603499
def plot(self, minx=-1.5, maxx=1.2, miny=-0.2, maxy=2, **kwargs):
        
        import matplotlib.pyplot as pp
        grid_width = max(maxx-minx, maxy-miny) / 200.0

        ax = kwargs.pop('ax', None)

        xx, yy = np.mgrid[minx:maxx:grid_width, miny:maxy:grid_width]
        V = self.potential(xx, yy)
        # clip off any values greater than 200, since they mess up
        # the color scheme
        if ax is None:
            ax = pp

        ax.contourf(xx, yy, V.clip(max=200), 40, **kwargs)
1039422
def setup_figure():
    """"""
    fig, axes = mplstereonet.subplots(ncols=2, figsize=(20,10))
    for ax in axes:
        # Make the grid lines solid.
        ax.grid(ls='-')
        # Make the longitude grids continue all the way to the poles
        ax.set_longitude_grid_ends(90)
    return fig, axes
475880
def plot(self, ax: GeoAxesSubplot, s: int = 10, **kwargs) -> Artist:
        """"""
        return ax.scatter(
            self.data.longitude,
            self.data.latitude,
            s=s,
            transform=PlateCarree(),
            **kwargs,
        )
258799
def plotline(plt, alpha, taus, style,label=""):
    
    y = [pow(tt, alpha) for tt in taus]
    plt.loglog(taus, y, style,label=label)
99722
def plot_figures():
    """"""
    rc("figure", figsize=[8.,4.])
    rc("figure.subplot", left=.08, top=.95, right=.98)
    rc("image", cmap="gray")
    seed(1000)

    Q1 = cp.Gamma(2)
    Q2 = cp.Normal(0, Q1)
    Q = cp.J(Q1, Q2)
    #end

    subplot(121)
    s,t = meshgrid(linspace(0,5,200), linspace(-6,6,200))
    contourf(s,t,Q.pdf([s,t]),50)
    xlabel("$q_1$")
    ylabel("$q_2$")
    subplot(122)
    Qr = Q.sample(500)
    scatter(*Qr, s=10, c="k", marker="s")
    xlabel("$Q_1$")
    ylabel("$Q_2$")
    axis([0,5,-6,6])

    savefig("multivariate.png"); clf()

    Q2 = cp.Gamma(1)
    Q1 = cp.Normal(Q2**2, Q2+1)
    Q = cp.J(Q1, Q2)
    #end

    subplot(121)
    s,t = meshgrid(linspace(-4,7,200), linspace(0,3,200))
    contourf(s,t,Q.pdf([s,t]),30)
    xlabel("$q_1$")
    ylabel("$q_2$")
    subplot(122)
    Qr = Q.sample(500)
    scatter(*Qr)
    xlabel("$Q_1$")
    ylabel("$Q_2$")
    axis([-4,7,0,3])

    savefig("multivariate2.png"); clf()
1244065
def plot_parameters(self, indices=None,figsize=(15,5),**kwargs):
        
        self.plot_z(indices,figsize,**kwargs)
419205
def _get_bottom_line_coordinates(self):
        """"""

        rect_x, rect_y, rect_width, rect_height = self.rect

        start_point = rect_x, rect_y + rect_height
        end_point = rect_x + rect_width, rect_y + rect_height

        return start_point, end_point
827462
def major_axis(points):
    
    U, S, V = np.linalg.svd(points)
    axis = util.unitize(np.dot(S, V))
    return axis
50888
def plot_data(self, proj, ax):
        
        x, y = proj
        x_data = self.ig.independent_data[x]
        y_data = self.ig.dependent_data[y]
        projected_data = np.column_stack((x_data, y_data)).T
        kde = gaussian_kde(projected_data)

        xx, yy = np.meshgrid(self.ig._x_points[x], self.ig._y_points[y])
        x_grid = xx.flatten()
        y_grid = yy.flatten()

        contour_grid = kde.pdf(np.column_stack((x_grid, y_grid)).T)
        # This is an fugly kludge, but it seems nescessary to make low density
        # areas show up.
        if self.ig.log_contour:
            contour_grid = np.log(contour_grid)
            vmin = -7
        else:
            vmin = None
        ax.contourf(xx, yy, contour_grid.reshape(xx.shape),
                    50, vmin=vmin, cmap='Blues')