Skip to content

Commit

Permalink
Handling the new matplotlib 3.8.0 API changes. (#1413)
Browse files Browse the repository at this point in the history
  • Loading branch information
john-science authored Sep 15, 2023
1 parent 290db96 commit 2dab122
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion armi/reactor/converters/blockConverters.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ def plotConvertedBlock(self, fName=None):
circleComp, innerR, outerR
)
)
circle = Wedge((0.0, 0.0), outerR, 0, 360.0, outerR - innerR)
circle = Wedge((0.0, 0.0), outerR, 0, 360.0, width=outerR - innerR)
patches.append(circle)
colors.append(circleComp.density())
colorMap = matplotlib.cm
Expand Down
14 changes: 7 additions & 7 deletions armi/utils/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ def _makeAssemPatches(core):
x, y, _ = a.spatialLocator.getLocalCoordinates()
if nSides == 6:
assemPatch = matplotlib.patches.RegularPolygon(
(x, y), nSides, pitch / math.sqrt(3), orientation=math.pi / 2.0
(x, y), nSides, radius=pitch / math.sqrt(3), orientation=math.pi / 2.0
)
elif nSides == 4:
# for rectangle x, y is defined as sides instead of center
Expand Down Expand Up @@ -529,7 +529,7 @@ def legend_artist(self, _legend, orig_handle, _fontsize, handlebox):
patch = matplotlib.patches.RegularPolygon(
(x, y),
6,
height,
radius=height,
orientation=math.pi / 2.0,
facecolor=colorRgb,
transform=handlebox.get_transform(),
Expand All @@ -538,14 +538,14 @@ def legend_artist(self, _legend, orig_handle, _fontsize, handlebox):
patch = matplotlib.patches.Rectangle(
(x - height / 2, y - height / 2),
height * 2,
height,
height * 2,
facecolor=colorRgb,
transform=handlebox.get_transform(),
)
else:
patch = matplotlib.patches.Circle(
(x, y),
height,
radius=height,
facecolor=colorRgb,
transform=handlebox.get_transform(),
)
Expand Down Expand Up @@ -1185,7 +1185,7 @@ def _makeBlockPinPatches(block, cold):
x, y, _ = location.getLocalCoordinates()
if isinstance(comp, Hexagon):
derivedPatch = matplotlib.patches.RegularPolygon(
(x, y), 6, largestPitch / math.sqrt(3)
(x, y), 6, radius=largestPitch / math.sqrt(3)
)
elif isinstance(comp, Square):
derivedPatch = matplotlib.patches.Rectangle(
Expand Down Expand Up @@ -1301,7 +1301,7 @@ def _makeComponentPatch(component, position, cold):
else:
# Just make it a hexagon...
blockPatch = matplotlib.patches.RegularPolygon(
(x, y), 6, component.getDimension("op", cold=cold) / math.sqrt(3)
(x, y), 6, radius=component.getDimension("op", cold=cold) / math.sqrt(3)
)

elif isinstance(component, Rectangle):
Expand Down Expand Up @@ -1504,7 +1504,7 @@ def plotTriangleFlux(
triangle = patches.mpatches.RegularPolygon(
(xInCm, yInCm),
3,
sideLengthInCm / math.sqrt(3),
radius=sideLengthInCm / math.sqrt(3),
orientation=math.pi * flipped,
linewidth=0.0,
)
Expand Down

0 comments on commit 2dab122

Please sign in to comment.