Repository: ManimCommunity/manim
File: manim/utils/testing/_show_diff.py (Python)

Code before:
        x=0.55,
        y=0.45,
        s=f"Testname:\n {control_data_filename[:-4]}",
        wrap=True,
        transform=fig.transFigure,
        fontsize=14,
        verticalalignment="top",
    )
    number_of_matches = np.isclose(
        frame_data, expected_frame_data, atol=FRAME_ABSOLUTE_TOLERANCE
    ).sum()
    number_of_mismatches = frame_data.size - number_of_matches
    fig.text(
        x=0.55,
        y=0.30,
        s=f"Difference count:\n {number_of_mismatches}",
        transform=fig.transFigure,
        fontsize=14,
        verticalalignment="top",
    )
    fig.text(
        x=0.55,
        y=0.15,
        s="Difference summary: \n  green = same\n  red = different",
        transform=fig.transFigure,
        fontsize=14,
        verticalalignment="top",
    )

    with warnings.catch_warnings():
        warnings.simplefilter("error")
        try:
            plt.show()
        except UserWarning:
            filename = f"{control_data_filename[:-4]}-diff.pdf"
            plt.savefig(filename)
            logging.warning(
                "Interactive matplotlib interface not available,"
                f" diff saved to {filename}."
            )


Review comment (suggestion):
I've been playing a bit with the heights and font sizes, making the text a bit smaller so that it doesn't fill too much space and moving it a bit around. I also added an extra space after the test name and the difference count in order to make it more aligned with the already existing "difference summary".

I suggest the following values:
```suggestion
    fig.text(
        x=0.55,
        y=0.46,
        s=f"Testname:\n  {control_data_filename[:-4]}",
        wrap=True,
        transform=fig.transFigure,
        fontsize=12,
        verticalalignment="top",
    )
    number_of_matches = np.isclose(
        frame_data, expected_frame_data, atol=FRAME_ABSOLUTE_TOLERANCE
    ).sum()
    number_of_mismatches = frame_data.size - number_of_matches
    fig.text(
        x=0.55,
        y=0.34,
        s=f"Difference count:\n  {number_of_mismatches}",
        transform=fig.transFigure,
        fontsize=12,
        verticalalignment="top",
    )
    fig.text(
        x=0.55,
        y=0.22,
        s="Difference summary: \n  green = same\n  red = different",
        transform=fig.transFigure,
        fontsize=12,
        verticalalignment="top",
    )
```

Code after:
        s=f"Testname:\n {control_data_filename[:-4]}",
        wrap=True,
        transform=fig.transFigure,
        fontsize=12,
        verticalalignment="top",
    )
    number_of_matches = np.isclose(
        frame_data, expected_frame_data, atol=FRAME_ABSOLUTE_TOLERANCE
    ).sum()
    number_of_mismatches = frame_data.size - number_of_matches
    fig.text(
        x=0.55,
        y=0.34,
        s=f"Difference count:\n {number_of_mismatches}",
        transform=fig.transFigure,
        fontsize=12,
        verticalalignment="top",
    )
    fig.text(
        x=0.55,
        y=0.22,
        s="Difference summary: \n  green = same\n  red = different",
        transform=fig.transFigure,
        fontsize=12,
        verticalalignment="top",
    )

    with warnings.catch_warnings():
        warnings.simplefilter("error")
        try:
            plt.show()
        except UserWarning:
            filename = f"{control_data_filename[:-4]}-diff.pdf"
            plt.savefig(filename)
            logging.warning(
                "Interactive matplotlib interface not available,"
                f" diff saved to {filename}."
            )