Skip to content

Commit cafeba8

Browse files
authored
Merge pull request #376 from Dessia-tech/375-bug-arc2d-mpl_plot
add fix to Arc2D: mpl_plot
2 parents c95edc5 + 37a9b05 commit cafeba8

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2020

2121
### Fix
2222
- Remove offline mode
23+
- Arc2D: mpl_plot
2324

2425
### Refactor
2526
- Implements InteractiveObject for handling all mouse objects in one class

plot_data/core.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1177,11 +1177,14 @@ def mpl_plot(self, ax=None, **kwargs):
11771177
kwargs.pop("edge_style")
11781178
else:
11791179
edgecolor = plot_data.colors.BLACK.rgb
1180+
theta1, theta2 = self.start_angle, self.end_angle
1181+
if self.clockwise:
1182+
theta1, theta2 = self.end_angle, self.start_angle
11801183

11811184
ax.add_patch(
11821185
Arc((self.cx, self.cy), 2 * self.r, 2 * self.r, angle=0,
1183-
theta1=self.start_angle * 0.5 / math.pi * 360,
1184-
theta2=self.end_angle * 0.5 / math.pi * 360,
1186+
theta1=theta1 * 0.5 / math.pi * 360,
1187+
theta2=theta2 * 0.5 / math.pi * 360,
11851188
edgecolor=edgecolor), **kwargs)
11861189

11871190
return ax

0 commit comments

Comments
 (0)