pymks/tools.py
def _draw_components_3D(X, labels, title, component_labels):
    """
    Helper function to plot 2 components.

    Args:
        X: Arrays with low dimensional data
        labels: labels for each of the low dimensional arrays
    """
    n_sets = len(X)
    color_list = _get_color_list(n_sets)
    fig = plt.figure()
    ax = fig.add_subplot(111, projection='3d')
    ax.set_xlabel('Component ' + str(component_labels[0]), fontsize=10)
    ax.set_ylabel('Component ' + str(component_labels[1]), fontsize=10)
    ax.set_zlabel('Component ' + str(component_labels[2]), fontsize=10)
    X_array = np.concatenate(X)
    x_min, x_max = [np.min(X_array[:, 0]), np.max(X_array[:, 0])]
    y_min, y_max = [np.min(X_array[:, 1]), np.max(X_array[:, 1])]
    z_min, z_max = [np.min(X_array[:, 2]), np.max(X_array[:, 2])]
    x_epsilon = (x_max - x_min) * 0.05
    y_epsilon = (y_max - y_min) * 0.05
    z_epsilon = (z_max - z_min) * 0.05
    ax.set_xlim([x_min - x_epsilon, x_max + x_epsilon])
    ax.set_ylim([y_min - y_epsilon, y_max + y_epsilon])
    ax.set_zlim([z_min - z_epsilon, z_max + z_epsilon])
    for label, pts, color in zip(labels, X, color_list):
        ax.plot(pts[:, 0], pts[:, 1], pts[:, 2], 'o', color=color, label=label)
    plt.title(title, fontsize=15)
    plt.legend(bbox_to_anchor=(1.05, 1), loc=2, borderaxespad=0., fontsize=15)
    plt.show()

    Helper function to plot 2 components.

    Args:
        X: Arrays with low dimensional data
        labels: labels for each of the low dimensional arrays
    
Helper function to plot 2 components.
Helper function to plot 2 components .
def _draw_components_3D(X, labels, title, component_labels):
    n_sets = len(X)
    color_list = _get_color_list(n_sets)
    fig = plt.figure()
    ax = fig.add_subplot(111, projection='3d')
    ax.set_xlabel('Component ' + str(component_labels[0]), fontsize=10)
    ax.set_ylabel('Component ' + str(component_labels[1]), fontsize=10)
    ax.set_zlabel('Component ' + str(component_labels[2]), fontsize=10)
    X_array = np.concatenate(X)
    x_min, x_max = [np.min(X_array[:, 0]), np.max(X_array[:, 0])]
    y_min, y_max = [np.min(X_array[:, 1]), np.max(X_array[:, 1])]
    z_min, z_max = [np.min(X_array[:, 2]), np.max(X_array[:, 2])]
    x_epsilon = (x_max - x_min) * 0.05
    y_epsilon = (y_max - y_min) * 0.05
    z_epsilon = (z_max - z_min) * 0.05
    ax.set_xlim([x_min - x_epsilon, x_max + x_epsilon])
    ax.set_ylim([y_min - y_epsilon, y_max + y_epsilon])
    ax.set_zlim([z_min - z_epsilon, z_max + z_epsilon])
    for label, pts, color in zip(labels, X, color_list):
        ax.plot(pts[:, 0], pts[:, 1], pts[:, 2], 'o', color=color, label=label)
    plt.title(title, fontsize=15)
    plt.legend(bbox_to_anchor=(1.05, 1), loc=2, borderaxespad=0., fontsize=15)
    plt.show()
def _draw_components_3D ( X , labels , title , component_labels ) : n_sets = len ( X ) color_list = _get_color_list ( n_sets ) fig = plt . figure ( ) ax = fig . add_subplot ( 111 , projection = '3d' ) ax . set_xlabel ( 'Component ' + str ( component_labels [ 0 ] ) , fontsize = 10 ) ax . set_ylabel ( 'Component ' + str ( component_labels [ 1 ] ) , fontsize = 10 ) ax . set_zlabel ( 'Component ' + str ( component_labels [ 2 ] ) , fontsize = 10 ) X_array = np . concatenate ( X ) x_min , x_max = [ np . min ( X_array [ : , 0 ] ) , np . max ( X_array [ : , 0 ] ) ] y_min , y_max = [ np . min ( X_array [ : , 1 ] ) , np . max ( X_array [ : , 1 ] ) ] z_min , z_max = [ np . min ( X_array [ : , 2 ] ) , np . max ( X_array [ : , 2 ] ) ] x_epsilon = ( x_max - x_min ) * 0.05 y_epsilon = ( y_max - y_min ) * 0.05 z_epsilon = ( z_max - z_min ) * 0.05 ax . set_xlim ( [ x_min - x_epsilon , x_max + x_epsilon ] ) ax . set_ylim ( [ y_min - y_epsilon , y_max + y_epsilon ] ) ax . set_zlim ( [ z_min - z_epsilon , z_max + z_epsilon ] ) for label , pts , color in zip ( labels , X , color_list ) : ax . plot ( pts [ : , 0 ] , pts [ : , 1 ] , pts [ : , 2 ] , 'o' , color = color , label = label ) plt . title ( title , fontsize = 15 ) plt . legend ( bbox_to_anchor = ( 1.05 , 1 ) , loc = 2 , borderaxespad = 0. , fontsize = 15 ) plt . show ( )
Helper function to plot 2 components.
Helper function to plot 2 components .
"""
    Helper function to plot 2 components.

    Args:
        X: Arrays with low dimensional data
        labels: labels for each of the low dimensional arrays
    """
X
Arrays with low dimensional data
Arrays with low dimensional data
labels
labels for each of the low dimensional arrays
labels for each of the low dimensional arrays
title
component_labels