bluemira.utilities.plot_tools ============================= .. py:module:: bluemira.utilities.plot_tools .. autoapi-nested-parse:: A collection of plotting tools. Classes ------- .. autoapisummary:: bluemira.utilities.plot_tools.Plot3D bluemira.utilities.plot_tools.BluemiraPathPatch3D Functions --------- .. autoapisummary:: bluemira.utilities.plot_tools.str_to_latex bluemira.utilities.plot_tools.make_gif bluemira.utilities.plot_tools.save_figure bluemira.utilities.plot_tools.coordinates_to_path bluemira.utilities.plot_tools.smooth_contour_fill Module Contents --------------- .. py:function:: str_to_latex(string: str) -> str Create a new string which can be printed in LaTEX nicely. :param string: The string to be converted :returns: * *The mathified string* * *'I_m_p' ==> '$I_{m_{p}}$'* .. py:function:: make_gif(folder: str, figname: str, file_format: str = 'png', *, clean: bool = True) Make a GIF image from a set of images with similar names in a folder. Figures are sorted in increasing order based on a trailing number, e.g. 'figure_A[1, 2, 3, ..].png' Cleans up the temporary figure files (deletes!) Creates a GIF file in the folder directory :param folder: Full path folder name :param figname: Figure name prefix :param file_format: Figure filename extension :param clean: Delete figures after completion? .. py:function:: save_figure(fig, name, *, save=False, folder=None, dpi=600, file_format='svg', **kwargs) Saves a figure to the directory if save flag active .. py:function:: coordinates_to_path(x: numpy.ndarray, z: numpy.ndarray) -> matplotlib.path.Path Convert coordinates to path vertices. :returns: The path vertices .. py:function:: smooth_contour_fill(ax: matplotlib.axes.Axes, contour: matplotlib.contour.ContourSet, cut_edge: bluemira.geometry.coordinates.Coordinates) Smooths the edge of a filled contour with a set of coordinates .. py:class:: Plot3D Bases: :py:obj:`mpl_toolkits.mplot3d.Axes3D` .. autoapi-inheritance-diagram:: bluemira.utilities.plot_tools.Plot3D :parts: 1 :private-bases: Cheap and cheerful .. py:class:: BluemiraPathPatch3D(path: matplotlib.path.Path, normal: numpy.ndarray, translation: numpy.ndarray | None = None, color: str = 'b', **kwargs) Bases: :py:obj:`mpl_toolkits.mplot3d.art3d.PathPatch3D` .. autoapi-inheritance-diagram:: bluemira.utilities.plot_tools.BluemiraPathPatch3D :parts: 1 :private-bases: Class for a 3-D PathPatch which can actually be filled properly! :param path: The path object to plot in 3-D :param normal: The 3-D normal vector of the face :param translation: Translation vector to apply to the face :param color: The color to plot the fill .. py:attribute:: _patch2d .. py:attribute:: _path2d .. py:attribute:: _code3d .. py:attribute:: _facecolor3d .. py:attribute:: _segment3d .. py:method:: __getattr__(key: str) Transfer the key getattr to underlying PathPatch object. :returns: The key's value