diff --git a/lbmpy/plot2d.py b/lbmpy/plot2d.py index 6b72fdcdac37fff54f87203ca190669077b307ee..87c1cc3a9fc49ebc8656d0c8c0f383486ca7c0b8 100644 --- a/lbmpy/plot2d.py +++ b/lbmpy/plot2d.py @@ -1,6 +1,4 @@ -from itertools import cycle import matplotlib.patches as patches -from matplotlib.text import Text from pystencils import make_slice from pystencils.plot2d import * @@ -63,28 +61,6 @@ def boundary_handling(boundary_handling_obj, slice_obj=None, boundary_name_to_co legend(handles=path_list, bbox_to_anchor=(1.02, 0.5), loc=2, borderaxespad=0.) -def phase_plot(phase_field: np.ndarray, linewidth=1.0, clip=True) -> None: - """Plots a phase field array using the phase variables as alpha channel. - - Args: - phase_field: array with len(shape) == 3, first two dimensions are spatial, the last one indexes the phase - components. - linewidth: line width of the 0.5 contour lines that are drawn over the alpha blended phase images - clip: see scalar_field_alpha_value function - """ - color_cycle = cycle(['#fe0002', '#00fe00', '#0000ff', '#ffa800', '#f600ff']) - - assert len(phase_field.shape) == 3 - - with warnings.catch_warnings(): - warnings.simplefilter("ignore") - for i in range(phase_field.shape[-1]): - scalar_field_alpha_value(phase_field[..., i], next(color_cycle), clip=clip, interpolation='bilinear') - if linewidth: - for i in range(phase_field.shape[-1]): - scalar_field_contour(phase_field[..., i], levels=[0.5], colors='k', linewidths=[linewidth]) - - def phase_plot_for_step(phase_field_step, slice_obj=make_slice[:, :], **kwargs): concentrations = phase_field_step.concentration[slice_obj] phase_plot(concentrations, **kwargs)