polymerist.graphics.plotutils
Tools for generating plots and other graphics
Attributes
Functions
|
Prepare a grid of predetermined number of matplotlib subplot axes of a particular size and aspect ratio |
|
Takes a DataFrame populated with polymer time series property data and generates sequential plots |
|
Plot an Nx3 array of (x, y, z) coordinate sets in 3-D |
|
Wrapper for making normalized color map function |
Plots a PIL image with a colorbar and norm of ones choice |
|
|
Create a matplotlib colorbar object with appropriate norm, color scale, and labels |
|
Generate named labels for discrete colormaps (e.g. Qualitative colormaps) |
Module Contents
- polymerist.graphics.plotutils.ColorMapper
- polymerist.graphics.plotutils.presize_subplots(nrows: int, ncols: int, scale: float = 15.0, elongation: float = 1.0) tuple[matplotlib.pyplot.Figure, numpy.ndarray[matplotlib.pyplot.Axes]][source]
Prepare a grid of predetermined number of matplotlib subplot axes of a particular size and aspect ratio Returns the resulting Figure and array of individual subplot Axes
- polymerist.graphics.plotutils.plot_df_props(x_dframe: pandas.DataFrame, y_dframe: pandas.DataFrame, df_label: str | None = None, nrows: int = None, ncols: int = None, **plot_kwargs) tuple[matplotlib.pyplot.Figure, matplotlib.pyplot.Axes][source]
Takes a DataFrame populated with polymer time series property data and generates sequential plots
- polymerist.graphics.plotutils.scatter_3D(array: numpy.array) None[source]
Plot an Nx3 array of (x, y, z) coordinate sets in 3-D
- polymerist.graphics.plotutils.make_cmapper(cmap_name: str, vmin: float, vmax: float) ColorMapper[source]
Wrapper for making normalized color map function
- polymerist.graphics.plotutils.plot_image_with_colorbar(image: PIL.Image.Image, cmap: matplotlib.colors.Colormap, norm: matplotlib.colors.Normalize, label: str = '', ticks: list[float] | None = None, orient: str | None = None, dim: int = 8, aspect: float = 1 / 1) tuple[matplotlib.pyplot.Figure, matplotlib.pyplot.Axes][source]
Plots a PIL image with a colorbar and norm of ones choice
- polymerist.graphics.plotutils.draw_colorbar(cmap_name: str, vmin: float, vmax: float, label: str, save_path: pathlib.Path = None) matplotlib.colorbar.Colorbar[source]
Create a matplotlib colorbar object with appropriate norm, color scale, and labels
- polymerist.graphics.plotutils.label_discrete_cmap(cmap: matplotlib.colors.Colormap, color_names: Iterable[str], hues_per_color: int = 1) tuple[dict[str, tuple[int, int, int, int]], numpy.ndarray][source]
Generate named labels for discrete colormaps (e.g. Qualitative colormaps) Accepts the target Colormap, a collection of the unique colors present (in order), and the number of distinct hues per color Returns a dict mapping the named colors, as well as an MxNx4 array of the RGBA colors which can be visualized as an image