pymks/tools.py
def draw_components(datasets, labels, title=None, component_labels=None):
    """
    Visualize low dimensional representations of microstructures.

    Args:
        datasets (list, 2D arrays): low dimensional data with dimensions
            [n_samplles, n_componts]. The length of n_components must be 2 or
            3.
        labels (list, str): list of labes for each of each array datasets
        title: main title for plot
        component_labels: labels for components

    """
    plt.close('all')
    if title is None:
        title = 'Low Dimensional Representation'
    n_components = np.array(datasets[0][-1].shape)
    if component_labels is None:
        component_labels = range(1, n_components + 1)
    if len(datasets) != len(labels):
        raise RuntimeError('datasets and labels must have the same length')
    if n_components != len(component_labels):
        raise RuntimeError('number of components and component_labels must'
                           ' have the same length')
    if n_components[-1] == 2:
        _draw_components_2D(datasets, labels, title, component_labels[:2])
    elif n_components[-1] == 3:
        _draw_components_3D(datasets, labels, title, component_labels)
    else:
        raise RuntimeError("n_components must be 2 or 3.")

    Visualize low dimensional representations of microstructures.

    Args:
        datasets (list, 2D arrays): low dimensional data with dimensions
            [n_samplles, n_componts]. The length of n_components must be 2 or
            3.
        labels (list, str): list of labes for each of each array datasets
        title: main title for plot
        component_labels: labels for components

    
Visualize low dimensional representations of microstructures.
Visualize low dimensional representations of microstructures .
def draw_components(datasets, labels, title=None, component_labels=None):
    plt.close('all')
    if title is None:
        title = 'Low Dimensional Representation'
    n_components = np.array(datasets[0][-1].shape)
    if component_labels is None:
        component_labels = range(1, n_components + 1)
    if len(datasets) != len(labels):
        raise RuntimeError('datasets and labels must have the same length')
    if n_components != len(component_labels):
        raise RuntimeError('number of components and component_labels must'
                           ' have the same length')
    if n_components[-1] == 2:
        _draw_components_2D(datasets, labels, title, component_labels[:2])
    elif n_components[-1] == 3:
        _draw_components_3D(datasets, labels, title, component_labels)
    else:
        raise RuntimeError("n_components must be 2 or 3.")
def draw_components ( datasets , labels , title = None , component_labels = None ) : plt . close ( 'all' ) if title is None : title = 'Low Dimensional Representation' n_components = np . array ( datasets [ 0 ] [ - 1 ] . shape ) if component_labels is None : component_labels = range ( 1 , n_components + 1 ) if len ( datasets ) != len ( labels ) : raise RuntimeError ( 'datasets and labels must have the same length' ) if n_components != len ( component_labels ) : raise RuntimeError ( 'number of components and component_labels must' ' have the same length' ) if n_components [ - 1 ] == 2 : _draw_components_2D ( datasets , labels , title , component_labels [ : 2 ] ) elif n_components [ - 1 ] == 3 : _draw_components_3D ( datasets , labels , title , component_labels ) else : raise RuntimeError ( "n_components must be 2 or 3." )
Visualize low dimensional representations of microstructures.
Visualize low dimensional representations of microstructures .
"""
    Visualize low dimensional representations of microstructures.

    Args:
        datasets (list, 2D arrays): low dimensional data with dimensions
            [n_samplles, n_componts]. The length of n_components must be 2 or
            3.
        labels (list, str): list of labes for each of each array datasets
        title: main title for plot
        component_labels: labels for components

    """
datasets
low dimensional data with dimensions
[n_samplles, n_componts]. The length of n_components must be 2 or
3.
low dimensional data with dimensions [ n_samplles n_componts ] . The length of n_components must be 2 or 3 .
labels
list of labes for each of each array datasets
list of labes for each of each array datasets
title
main title for plot
main title for plot
component_labels
labels for components
labels for components