fusion-energy / openmc_regular_mesh_plotter

A Python package for plotting OpenMC regular mesh tally results with underlying geometry from neutronics simulations.
MIT License
9 stars 1 forks source link

matplotlib kwargs should be exposed to users #33

Closed RemDelaporteMathurin closed 10 months ago

RemDelaporteMathurin commented 2 years ago

https://github.com/fusion-energy/regular_mesh_plotter/blob/c5dbff275d56aaef8ec65fd7d85fc43091e6e8ee/regular_mesh_plotter/core.py#L17-L59

def plot_regular_mesh_values(
    values: np.ndarray,
    filename: Optional[str] = None,
    scale=None,  # LogNorm(),
    vmin=None,
    label="",
    title=None,
    base_plt=None,
    extent=None,
    x_label="X [cm]",
    y_label="Y [cm]",
    rotate_plot: float = 0,
):

Should be

def plot_regular_mesh_values(
    values: np.ndarray,
    filename: Optional[str] = None,
    label="",
    title=None,
    base_plt=None,
    x_label="X [cm]",
    y_label="Y [cm]",
    rotate_plot: float = 0,
    **kwargs
):
image_map = plt.imshow(values, **kwargs )

where kwargs are parameters compatible with imshow.

shimwell commented 2 years ago

Sounds like that would solve the logNorm issues as well. Nice 👍

We could put an example of using kwargs in the docstrings, just to be clear