Skip to content

fontsize parameter in deepinv.utils.plot has no effect #594

@Tmodrzyk

Description

@Tmodrzyk

The fontsize parameter in the plotting function deepinv.utils.plot has no apparent effect on any text in the output figure.
This behavior can be observed both on the saved images, and on the displayed images if you run it in a notebook.

I'm not very familiar with matplotlib's internals, but I guess the fontsize should be passed as a kwarg to most of the functions in plot, instead of using config_matplotlib which seems to have no effect at the moment.

Minimal example to reproduce the bug:

import torch
from deepinv.utils import plot
from pathlib import Path

x0 = torch.randn(1, 3, 256, 256)
x1 = torch.randn(1, 3, 256, 256)

save_dir = Path("./fontsize50/")

plot(
    img_list=[x0, x1],
    titles=["Image 1", "Image 2"],
    suptitle="Fontsize 50",
    figsize=(10, 4),
    fontsize=50,
    rescale_mode="clip",
    save_dir=save_dir,
)
save_dir = Path("./fontsize17/")

plot(
    img_list=[x0, x1],
    titles=["Image 1", "Image 2"],
    suptitle="Fontsize 17",
    figsize=(10, 4),
    fontsize=17,
    rescale_mode="clip",
    save_dir=save_dir,
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions