Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added default interpolation to remove noise on log plots #61

Merged
merged 1 commit into from
Nov 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions src/openmc_regular_mesh_plotter/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,11 @@ def plot_mesh_tally(
colorbar_kwargs : dict
Keyword arguments passed to :func:`matplotlib.colorbar.Colorbar`.
outline_kwargs : dict
Keyword arguments passed to :func:`matplotlib.pyplot.contour`.
Keyword arguments passed to :func:`matplotlib.pyplot.contour`. Defaults
to "colors": "black", "linestyles": "solid", "linewidths": 1
**kwargs
Keyword arguments passed to :func:`matplotlib.pyplot.imshow`
Keyword arguments passed to :func:`matplotlib.pyplot.imshow`. Defaults
to {"interpolation", "none"}.
Returns
-------
matplotlib.image.AxesImage
Expand Down Expand Up @@ -177,7 +179,11 @@ def plot_mesh_tally(
axes.set_xlabel(xlabel)
axes.set_ylabel(ylabel)

im = axes.imshow(data, extent=(x_min, x_max, y_min, y_max), **kwargs)
# zero values with logscale produce noise / fuzzy on the time but setting interpolation to none solves this
default_imshow_kwargs = {"interpolation": "none"}
default_imshow_kwargs.update(kwargs)

im = axes.imshow(data, extent=(x_min, x_max, y_min, y_max), **default_imshow_kwargs)

if colorbar:
fig.colorbar(im, **colorbar_kwargs)
Expand Down
Loading