pybilt.plot_generation package

Submodules

pybilt.plot_generation.plot_generation_functions module

A set of functions to generate plots/figures from the lipid bilayer analysis outputs. These functions use matplotlib (http://matplotlib.org/index.html) along with Seaborn ( https://stanford.edu/~mwaskom/software/seaborn/index.html).

pybilt.plot_generation.plot_generation_functions.gen_step_vector_ghost_tails(vectors_resnames, length=5, periodic_cut=75.0)[source]
pybilt.plot_generation.plot_generation_functions.gen_step_vector_net_ghost_tails(vectors_resnames, length=6, group_size=2, periodic_cut=75.0)[source]
pybilt.plot_generation.plot_generation_functions.gen_step_vector_smooth_ghost_tails(vectors_resnames, length=9, window=3, periodic_cut=75.0)[source]
pybilt.plot_generation.plot_generation_functions.gen_step_vector_smooth_ghost_tails_forwards(vectors_resnames, length_back=9, length_forward=9, window=3, periodic_cut=75.0)[source]
pybilt.plot_generation.plot_generation_functions.plot(dat_list, yerr_list=None, xerr_list=None, name_list=None, filename='plot.eps', save=True, show=False, xlabel=None, ylabel=None, marker=None, linestyle=None, xticks=None)[source]

Generic plotting function for (multiple) xy datasets.

Parameters
  • dat_list (list or list like) – List of tuples of data vectors in the format [(x_0, y_0), (x_1. y_1), … ]

  • yerr_list (list or list like) – List of the yerr vectors. e.g. [y_0_err, y_1_err, … ]

  • name_list (list or list like, Optional) – List of string legend names to assign the curves being plotted.

  • filename (str, Optional) – The string containing the path and filename for the exported plot file.

  • save (bool, Optional) – Set whether to save the generated plot to disc with filename. Default: True

  • show (bool, Optional) – Set whether to show the generated plot in an interactive window (i.e. plt.show()). Default: False

  • xlabel (str, Optional) – Specify a x-axis label.

  • ylabel (str, Optional) – Specify a y-axis label

  • marker (str, Optional) – Specify a matplotlib marker type for data points.

pybilt.plot_generation.plot_generation_functions.plot_area_per_lipid(apl_dat_list, name_list=None, filename='apl.pdf', time_in='ps', time_out='ns', save=True, show=False, interval=1, ylim=None, xlim=None)[source]

Generates a single plot with area per lipid (apl) curves Takes outputs from:

MemSys.CalcAreaPerLipid_Box MemSys.CalcAreaPerLipid_ClosestNeighborCircle

The outputs are passed to function in a list input: apl_dat_list

pybilt.plot_generation.plot_generation_functions.plot_average_deuterium_op(dop_dat_list, name_list=None, filename='dop.pdf', time_in='ps', time_out='ns', show=False, interval=1)[source]

Generates a single plot of the average deuterium order parameter vs. time

The outputs are passed to function in a list input: dop_dat_list

pybilt.plot_generation.plot_generation_functions.plot_bilayer_thickness(bt_dat_list, name_list=None, filename='bilayer_thickness.pdf', time_in='ps', time_out='ns', show=False, interval=1, save=True, xlim=None, ylim=None)[source]

Generates a single plot with bilayer thickness curves Takes outputs from:

The outputs are passed to function in a list input: bt_dat_list

pybilt.plot_generation.plot_generation_functions.plot_corr_mat(in_corrmat, save=True, filename='correlation_matrix.pdf', show=False)[source]
pybilt.plot_generation.plot_generation_functions.plot_corr_mat_as_scatter(in_corrmat, save=True, filename='correlation_matrix.pdf', show=False)[source]
pybilt.plot_generation.plot_generation_functions.plot_dc_cluster_dat_number(clust_dat_list, name_list=None, filename='clust_number.pdf', time_in='ps', time_out='ns', save=True, show=False)[source]

Generates a plot of the average number of clusters (vs. time) This function generates a plot of the average number of clusters vs. time for data output with key ‘nclusters’

from the ‘dc_cluster’ analysis in the BilayerAnalyzer, which corresponds to the

bilayer_analyzer.analysis_protocols.DCClusterProtocol analysis protocol class. :Parameters: * clust_dat_list (list) – This is a list of all data to plot and should be a list of tuples/lists where

each element tuple has the data arrays for each time series curve to include in the plot: e.g. [ (times_1, means_1, stds_1), (times_2, means_2, stds_2) ]

  • name_list (list, optional) – This is a list of string names to assign each curve included in the plot. It should have len(name_list) == len(clust_dat_list) = True.

    Default: None

  • filename (str, optional) – This a string containing the filename for the output plot if save is set to True. Default: ‘clust_number.pdf’

  • time_in (str, optional) – This is a string specifying the time units of values in the input arrays. Acceptible values are ‘ps’ for picosecond and ‘ns’ nanosecond.

    Default: ‘ps’

  • time_out (str, optional) – This is a string specifying the time units to use in the output plot. Acceptible values are ‘ps’ for picosecond and ‘ns’ nanosecond. If this is different than the value for time_in then the time values will be scaled accordingly.

    Default: ‘ns’

  • save (bool, optional) – This is boolean switch to set whether or not to save the generated plot to disc. plt.savefig is called.

    Default: True

  • show (bool, optional) – This is boolean switch to set whether or not the generated plot is displayed in interactive mode using plt.show.

    Default: False

pybilt.plot_generation.plot_generation_functions.plot_dc_cluster_dat_number_comtraj(clust_dat_list, name_list=None, filename='clust_number.pdf', time_in='ps', time_out='ns', show=False)[source]

Generates a single of the average number of clusters (vs. time) using output data from:

MemSys.CheckClustering

The outputs are passed to function in a list input: clust_dat_list

pybilt.plot_generation.plot_generation_functions.plot_dc_cluster_dat_size(clust_dat_list, name_list=None, filename='clust_number.pdf', time_in='ps', time_out='ns', save=True, show=False)[source]

Generates a plot of the average cluster size (vs. time) This function generates a plot of the average cluster size vs. time for data output with key ‘avg_size’ from the ‘dc_cluster’ analysis in the BilayerAnalyzer, which corresponds to the bilayer_analyzer.analysis_protocols.DCClusterProtocol analysis protocol class. :Parameters: * clust_dat_list (list) – This is a list of all data to plot and should be a list of tuples/lists where

each element tuple has the data arrays for each time series curve to include in the plot: e.g. [ (times_1, means_1, stds_1), (times_2, means_2, stds_2) ]

  • name_list (list, optional) – This is a list of string names to assign each curve included in the plot. It should have len(name_list) == len(clust_dat_list) = True.

    Default: None

  • filename (str, optional) – This a string containing the filename for the output plot if save is set to True. Default: ‘clust_number.pdf’

  • time_in (str, optional) – This is a string specifying the time units of values in the input arrays. Acceptible values are ‘ps’ for picosecond and ‘ns’ nanosecond.

    Default: ‘ps’

  • time_out (str, optional) – This is a string specifying the time units to use in the output plot. Acceptible values are ‘ps’ for picosecond and ‘ns’ nanosecond. If this is different than the value for time_in then the time values will be scaled accordingly.

    Default: ‘ns’

  • save (bool, optional) – This is boolean switch to set whether or not to save the generated plot to disc. plt.savefig is called.

    Default: True

  • show (bool, optional) – This is boolean switch to set whether or not the generated plot is displayed in interactive mode using plt.show.

    Default: False

pybilt.plot_generation.plot_generation_functions.plot_dc_cluster_dat_size_comtraj(clust_dat_list, name_list=None, filename='clust_size.pdf', time_in='ps', time_out='ns', show=False)[source]

Generates a single plot of the average cluster size (vs time) using output data from:

MemSys.CheckClustering

The outputs are passed to function in a list input: clust_dat_list

pybilt.plot_generation.plot_generation_functions.plot_dc_cluster_maps_comtraj(clusters, filename='cluster_map.pdf', show=False)[source]

Generates a single plot of the lipid cluster map Takes a single frame of the output from:

MemSys.ExportClustersForPlotting

pybilt.plot_generation.plot_generation_functions.plot_density_profile(dp_out_list, save=True, filename='density_profile.pdf', show=False, label_list=None, ylabel='Density')[source]

Plot density profiles This function can be used to plot the results of density profiles functions in the mda_density_profile module.

Parameters
  • dp_out_list (list of tuples) – A list of the tuple outputs of the profile calculation functions

  • save (bool, optional) – Default is True. Saves the plot output as an image file if True.

  • filename (str, optional) – The name out the image file that will be created if save=True.

  • show (bool, optional) – Default is False. Display the plot (plt.show) if True.

  • label_list (list of str – None, optional): Default is None. Allows a list of strings used to label the plot lines.

pybilt.plot_generation.plot_generation_functions.plot_displacement_lipid_type_cross_correlation(analyzer_data, filename='normal_displacement_lipid_type_cross_correlation.pdf', show=False, save=True)[source]
pybilt.plot_generation.plot_generation_functions.plot_ebar_hists(center_count_err, name_list=None, filename='ebar_hist.eps', save=True, show=False, xlabel=None, ylabel='Counts')[source]

Generic plotting function for (multiple) xy datasets.

Parameters
  • dat_list (list or list like) – List of tuples of data vectors in the format [(x_0, y_0), (x_1. y_1), … ]

  • yerr_list (list or list like) – List of the yerr vectors. e.g. [y_0_err, y_1_err, … ]

  • name_list (list or list like, Optional) – List of string legend names to assign the curves being plotted.

  • filename (str, Optional) – The string containing the path and filename for the exported plot file.

  • save (bool, Optional) – Set whether to save the generated plot to disc with filename. Default: True

  • show (bool, Optional) – Set whether to show the generated plot in an interactive window (i.e. plt.show()). Default: False

  • xlabel (str, Optional) – Specify a x-axis label.

  • ylabel (str, Optional) – Specify a y-axis label

  • marker (str, Optional) – Specify a matplotlib marker type for data points.

pybilt.plot_generation.plot_generation_functions.plot_grid_as_scatter(in_xyzc, save=True, filename='lipid_grid.pdf', show=False, colorbar=False, cmap=None, vmin=None, vmax=None)[source]
pybilt.plot_generation.plot_generation_functions.plot_lipid_grid_thickness_map_2d(x_centers, y_centers, thickness_grid, save=True, filename='bilayer_thickness_map_2d.pdf', show=False, colorbar=True, vmin=0.0, vmax=None, interpolation='none')[source]
pybilt.plot_generation.plot_generation_functions.plot_msd(msd_dat_list, name_list=None, filename='msd.pdf', time_in='ps', time_out='ns', show=False, interval=1, save=True)[source]

Generates a single plot with Mean Squared Displacement curves Takes outputs from:

MemSys.CalcMSD MemSys.CalcMSD_parallel

The outputs are passed to function in a list input: apl_dat_list

pybilt.plot_generation.plot_generation_functions.plot_position_density_map_2d(x_centers, y_centers, counts, save=True, filename='position_density_2d.pdf', show=False, colorbar=True, vmin=0.0, vmax=None, normalized=False, scaled_to_max=False, interpolation='none')[source]
pybilt.plot_generation.plot_generation_functions.plot_position_density_map_2d_scatter(x_centers, y_centers, counts, save=True, filename='position_density_2d.pdf', show=False, colorbar=True, vmin=0.0, vmax=None, normalized=False, scaled_to_max=False)[source]
pybilt.plot_generation.plot_generation_functions.plot_spark(xdat, ydat, filename='plot.eps', save=True, show=False, color='#47d147')[source]

Generic plotting function for (multiple) xy datasets. Based on matplotlib spark_line function defined here: https://markhneedham.com/blog/2017/09/23/python-3-create-sparklines-using-matplotlib/ :Parameters: * dat_list (list or list like) – List of tuples of data vectors in the format [(x_0, y_0), (x_1. y_1), … ]

  • yerr_list (list or list like) – List of the yerr vectors. e.g. [y_0_err, y_1_err, … ]

  • name_list (list or list like, Optional) – List of string legend names to assign the curves being plotted.

  • filename (str, Optional) – The string containing the path and filename for the exported plot file.

  • save (bool, Optional) – Set whether to save the generated plot to disc with filename. Default: True

  • show (bool, Optional) – Set whether to show the generated plot in an interactive window (i.e. plt.show()). Default: False

  • xlabel (str, Optional) – Specify a x-axis label.

  • ylabel (str, Optional) – Specify a y-axis label

  • marker (str, Optional) – Specify a matplotlib marker type for data points.

pybilt.plot_generation.plot_generation_functions.plot_spark_error(xdat, ydat, error, filename='plot.eps', save=True, show=False, color='#47d147')[source]

Generic plotting function for (multiple) xy datasets. Based on matplotlib spark_line function defined here: https://markhneedham.com/blog/2017/09/23/python-3-create-sparklines-using-matplotlib/ :Parameters: * dat_list (list or list like) – List of tuples of data vectors in the format [(x_0, y_0), (x_1. y_1), … ]

  • yerr_list (list or list like) – List of the yerr vectors. e.g. [y_0_err, y_1_err, … ]

  • name_list (list or list like, Optional) – List of string legend names to assign the curves being plotted.

  • filename (str, Optional) – The string containing the path and filename for the exported plot file.

  • save (bool, Optional) – Set whether to save the generated plot to disc with filename. Default: True

  • show (bool, Optional) – Set whether to show the generated plot in an interactive window (i.e. plt.show()). Default: False

  • xlabel (str, Optional) – Specify a x-axis label.

  • ylabel (str, Optional) – Specify a y-axis label

  • marker (str, Optional) – Specify a matplotlib marker type for data points.

pybilt.plot_generation.plot_generation_functions.plot_spark_error_marker(xdat, ydat, error, filename='plot.eps', save=True, show=False, color='#47d147', marker='s')[source]

Generic plotting function for (multiple) xy datasets. Based on matplotlib spark_line function defined here: https://markhneedham.com/blog/2017/09/23/python-3-create-sparklines-using-matplotlib/ :Parameters: * dat_list (list or list like) – List of tuples of data vectors in the format [(x_0, y_0), (x_1. y_1), … ]

  • yerr_list (list or list like) – List of the yerr vectors. e.g. [y_0_err, y_1_err, … ]

  • name_list (list or list like, Optional) – List of string legend names to assign the curves being plotted.

  • filename (str, Optional) – The string containing the path and filename for the exported plot file.

  • save (bool, Optional) – Set whether to save the generated plot to disc with filename. Default: True

  • show (bool, Optional) – Set whether to show the generated plot in an interactive window (i.e. plt.show()). Default: False

  • xlabel (str, Optional) – Specify a x-axis label.

  • ylabel (str, Optional) – Specify a y-axis label

  • marker (str, Optional) – Specify a matplotlib marker type for data points.

pybilt.plot_generation.plot_generation_functions.plot_spark_marker(xdat, ydat, filename='plot.eps', save=True, show=False, color='#47d147', marker='s')[source]

Generic plotting function for (multiple) xy datasets. Based on matplotlib spark_line function defined here: https://markhneedham.com/blog/2017/09/23/python-3-create-sparklines-using-matplotlib/ :Parameters: * dat_list (list or list like) – List of tuples of data vectors in the format [(x_0, y_0), (x_1. y_1), … ]

  • yerr_list (list or list like) – List of the yerr vectors. e.g. [y_0_err, y_1_err, … ]

  • name_list (list or list like, Optional) – List of string legend names to assign the curves being plotted.

  • filename (str, Optional) – The string containing the path and filename for the exported plot file.

  • save (bool, Optional) – Set whether to save the generated plot to disc with filename. Default: True

  • show (bool, Optional) – Set whether to show the generated plot in an interactive window (i.e. plt.show()). Default: False

  • xlabel (str, Optional) – Specify a x-axis label.

  • ylabel (str, Optional) – Specify a y-axis label

  • marker (str, Optional) – Specify a matplotlib marker type for data points.

pybilt.plot_generation.plot_generation_functions.plot_spark_multi(xdats, ydats, filename='plot.eps', save=True, show=False, colors=None)[source]

Generic plotting function for (multiple) xy datasets. Based on matplotlib spark_line function defined here: https://markhneedham.com/blog/2017/09/23/python-3-create-sparklines-using-matplotlib/ :Parameters: * dat_list (list or list like) – List of tuples of data vectors in the format [(x_0, y_0), (x_1. y_1), … ]

  • yerr_list (list or list like) – List of the yerr vectors. e.g. [y_0_err, y_1_err, … ]

  • name_list (list or list like, Optional) – List of string legend names to assign the curves being plotted.

  • filename (str, Optional) – The string containing the path and filename for the exported plot file.

  • save (bool, Optional) – Set whether to save the generated plot to disc with filename. Default: True

  • show (bool, Optional) – Set whether to show the generated plot in an interactive window (i.e. plt.show()). Default: False

  • xlabel (str, Optional) – Specify a x-axis label.

  • ylabel (str, Optional) – Specify a y-axis label

  • marker (str, Optional) – Specify a matplotlib marker type for data points.

pybilt.plot_generation.plot_generation_functions.plot_step_vectors(vectors_resnames, filename='step_vectors.pdf', save=True, show=False, scaled=False, wrapped=False, ghost_tails=None, ghost_tail_alpha=0.5, ghost_tail_arrow=False, ylim=None, xlim=None)[source]

Generates a single plot with the lipid displacement vectors (or step vectors) Takes a single frame of the output from:

MemSys.StepVector

Corresponding colors (if multiple lipid types are included) can be generated using:

MemSys.StepVectorColors

pybilt.plot_generation.plot_generation_functions.plot_step_vectors_comtraj(vectors, colors=None, filename='step_vectors.pdf', show=False, save=True)[source]

Generates a single plot with the lipid displacement vectors (or step vectors) Takes a single frame of the output from:

MemSys.StepVector

Corresponding colors (if multiple lipid types are included) can be generated using:

MemSys.StepVectorColors

pybilt.plot_generation.plot_generation_functions.plot_step_vectors_stroboscopic(vectors_resnames, index=0, filename='step_vectors_stroboscopic.pdf', save=True, show=False, scaled=False, wrapped=False)[source]

Generates a stroboscopic trajectory plot with the displacement vectors (or step vectors) of a single lipid. Takes the output from the ‘disp_vec’ analysis of the bilayer_analyzer:

pybilt.plot_generation.plot_generation_functions.plot_xygrid_as_imshow(x_centers, y_centers, grid, filename='grid.pdf', save=True, show=False, colorbar=False, colorbarlabel=None, cmap=None, vmin=None, vmax=None, interpolation='none', xlabel=None, ylabel=None)[source]
pybilt.plot_generation.plot_generation_functions.update_rcparams(rcparams)[source]

Module contents