dlsmicro.backend.plot_tools

dlsmicro.backend.plot_tools.add_w_scaling(omega, scaling, w_b, placement)[source]

Plot a given scaling on complex modulus plot to compared against the complex modulus of a sample.

Parameters:
  • omega (1-d array) – Vector of frequency range covered by the complex modulus plotted in the plot
  • scaling (list of float) – List of 2 floats, where the first number is numerator of fraction and second is denominator of fraction
  • w_b (float) – Value of complex modulus plotted where scaling should appear on the plot
  • placement (list of float) – First element in list is lower bound of scaling line, second element in list is upper bound of scaling line, where both elements are values between 0 and 1. The value of the first element should be less than the value of the second element
dlsmicro.backend.plot_tools.bootstrap_freq_sweep(df, quantity, replicate_identifier, n_bootstrap, estimator=<function mean>)[source]
Gets bootstrap samples of an estimator for frequency (or time)
sweep data from a Dataframe. The Dataframe is assumed to contain a vector for a given quantity in which each vector replicate is labeled by a unique replicate identifier.
Parameters:
  • df (DataFrame) – Dataframe containing table of results from DLS microrheology analysis for a single condition
  • quantity (str) –

    Name of variable to plot as defined in the Dataframe replicate_identifier : str

    Name of quantity to average over
    n_bootstrap : int
    Number of points for bootstrap
  • estimator (callable function) –

    Function for evaluating center of distribution

    Returns

  • -------
  • M_bootstrap (2-d array) – Matrix in which each row represents a frequency sweep
dlsmicro.backend.plot_tools.bootstrap_freq_sweep_ci(df, quantity, replicate_identifier, n_bootstrap, ci, estimator=<function mean>)[source]
Gets bootstrap confidence interval for an estimator of
frequency sweep (or time sweep) data. Boot strap can be either a percentile bootstrap of an estimator of a studentized bootstrap of the mean
Parameters:
  • df (DataFrame) – Dataframe containing table of results from DLS microrheology analysis for a single condition
  • quantity (str) –

    Name of variable to plot as defined in the Dataframe replicate_identifier : str

    Name of quantity to average over
    n_bootstrap : int
    Number of points for bootstrap
    ci : float
    Percent of distribution included in error bars
  • estimator (callable function, optional) –

    Function for evaluating center of distribution

    Returns

  • -------
  • ci_low (1-d array) – Vector of the lower bound of the confidence interval over entire frequency range.
  • ci_high (1-d array) – Vector of the upper bound of the confidence interval over entire frequency range.
dlsmicro.backend.plot_tools.bootstrap_matrix_byrows(M, n_bootstrap, estimator)[source]
Gets bootstrap samples of an estimator for frequency (or time)
sweep data from a matrix containing all vectors for a given quantity over all replicates.
Parameters:
  • M (2-d array) –

    Matrix of all values for a given quantity over all replicates n_bootstrap : int

    Number of points for bootstrap
  • estimator (callable function) –

    Function for evaluating center of distribution

    Returns

  • -------
  • M_bootstrap (2-d array) – Matrix in which each row represents a frequency sweep
dlsmicro.backend.plot_tools.df_to_matrix(df, quantity, replicate_identifier)[source]
Construct a matrix from a Dataframe for a given vector-valued
quantity in which each vector replicate is labeled by a unique replicate identifier.
Parameters:
  • df (DataFrame) – Dataframe containing table of results from DLS microrheology analysis for a single condition
  • quantity (str) –

    Name of variable to plot as defined in the Dataframe replicate_identifier : str

    Name of quantity to average over

    Returns

  • -------
  • M (2-d array) – Matrix where each row is a replicate of the vector quantity.
dlsmicro.backend.plot_tools.plot_replicates_from_df(df, my_quantity, plot_ci=True, myci=68.0, estimator=<function mean>, color='m', ls='-', err_alpha=0.25, err_lw=2.5, identifier='replicate')[source]

Plot a given quantity from the Dataframe, averaging across all replicates in that Dataframe.

Parameters:
  • df (DataFrame) – Dataframe containing table of results from DLS microrheology analysis for a single condition
  • my_quantity (str) – Name of variable to plot as defined in the Dataframe
  • plot_ci (boolean, optional) – If True, plot error bars
  • myci (float, optional) –

    Percent of distribution plotted in error bars estimator : callable function, optional

    Function for evaluating main plotted value
    color : str, optional
    Color of plotted line
    ls : str, optional
    Linestyle of plotted line
    err_alpha : float, optional
    Transparency level of error bars
    err_lw : float, optional
    Linewidth of error bar outlines
    identifier : str, optional
    Name of quantity to average over