I am working with matplotlib patches and am trying to plot an ellipse at a specific angle. According to the code below, I think the line I have plotted should be at the exact same angle as the major axis of the ellipse (angle in degrees going anti-clockwise where 0 degrees is horizontal).
Unfortunately my reputation isn't good enough to post images, but if you run the code, you can see from the plot that they do not seem to align. (if you change the size of the plot you can make it look like they just about do, but surely they should still align no matter how you stretch the axis?)
Could anyone help to explain why this is and how I can remedy it?
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
import math
m = -1.34756097561
c = 337.518292683
angle_rad = np.arctan(m)
angle_deg = angle_rad*(180/math.pi)
major_ax = 5.0
minor_ax = 3.5
center = np.array([133.26666667, 157.93333333])
patch = mpatches.Ellipse(center, major_ax, minor_ax, angle_deg, fc='none', ls='solid', ec='g', lw='3.')
x = np.arange(131, 137)
fig, ax = plt.subplots()
line1 = plt.plot(x, m*x + c)
ax.add_patch(patch)
ax.set_xlim(130.5, 135.5)
ax.set_ylim(155.5, 160.5)
plt.plot(center[0], center[1], 'go')
plt.show()