Skip to content

Arc patch with starting and ending angle #8046

@pdhall99

Description

@pdhall99

Bug report

Bug summary

  • Arc patch does not behave as expected when drawing elliptical arcs between two angles specified by theta1 and theta2.

Code for reproduction

import matplotlib.pyplot as plt
from matplotlib.patches import Arc

# Ellipse parameters
R = 1.0
x, y = 0.0, 0.0
a, b = 2.0*R, R

# Figure setup
fig_width, fig_height = 3.30, 3.30
fig = plt.figure(figsize=(fig_width, fig_height), frameon=False)
ax = fig.add_axes([0.0, 0.0, 1.0, 1.0], aspect='equal')
ax.set_axis_off()
ax.set_xlim(-R*1.05, R*1.05)
ax.set_ylim(-R*1.05, R*1.05)
# Axes
ax.axhline(0.0)
ax.axvline(0.0)
# 45 degree line
ax.plot([0.0, 1.0], [0.0, 1.0], 'k--')
# Arcs
ax.add_patch(Arc((x, y), a, b, 
                 theta1=0.0, theta2=360.0, edgecolor='k'))
ax.add_patch(Arc((x, y), a, b,
                 theta1=0.0, theta2=45.0, edgecolor='r', lw=1.5))
fig.savefig('Arc_patch_bug.png')

Actual outcome

arc_patch_bug

Expected outcome

  • Red elliptical arc between the x-axis (0 degrees) and the dashed line (45 degrees), following the black ellipse.

Matplotlib version

  • Matplotlib 2.0.0, Python 2.7.13, OSX
  • Installed with MacPorts

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions