Skip to content

Commit

Permalink
fix: pr comments
Browse files Browse the repository at this point in the history
  • Loading branch information
dakshpokar committed Aug 27, 2024
1 parent 002dd5c commit 39a3bcd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion maidr/core/plot/heatmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class HeatPlot(
):
def __init__(self, ax: Axes, **kwargs) -> None:
self._fill_label = kwargs.pop("fill_label")
self._fmt = kwargs.pop("fmt", ".2f")
self._fmt = kwargs.pop("fmt")
super().__init__(ax, PlotType.HEAT)

def render(self) -> dict:
Expand Down
7 changes: 2 additions & 5 deletions maidr/patch/heatmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,14 @@
def heat(wrapped, _, args, kwargs) -> Axes | AxesImage:
# Check for additional label used by MAIDR heatmap.
fill_label = kwargs.pop("fill_label", "Fill")

_fmt = ".2f"
if "fmt" in kwargs:
_fmt = kwargs.get("fmt")
fmt = kwargs.get("fmt", "")

# Patch `ax.imshow()` and `seaborn.heatmap`.
plot = wrapped(*args, **kwargs)

# Extract the heatmap data points for MAIDR from the plots.
ax = FigureManager.get_axes(plot)
FigureManager.create_maidr(ax, PlotType.HEAT, fill_label=fill_label, fmt=_fmt)
FigureManager.create_maidr(ax, PlotType.HEAT, fill_label=fill_label, fmt=fmt)

# Return to the caller.
return plot
Expand Down

0 comments on commit 39a3bcd

Please sign in to comment.