I believe plt.axline was introduced recently, so you should update matplotlib first. I just tried and here it did not work with matplotlib 3.2.2 but works with version 3.3.3.
Note that if you don't need the line to be infinitely long but just need to plot a line between your two points, plt.plot(fa, trans, '-') is more concise.
1
u/marcelowiski Nov 29 '20
I imported just like that
1
u/Accidental_Arnold Nov 29 '20
You have plt.axline I believe you want plt.axhline or plt.axvline. axline is only for axes, not pyplots.
1
u/TheBobPlus Nov 30 '20
I believe
plt.axlinewas introduced recently, so you should update matplotlib first. I just tried and here it did not work with matplotlib 3.2.2 but works with version 3.3.3.Note that if you don't need the line to be infinitely long but just need to plot a line between your two points,
plt.plot(fa, trans, '-')is more concise.3
u/[deleted] Nov 29 '20 edited Nov 29 '20
Show how you imported
pyplot.Try for a quick fix if you haven't yet:
from matplotlib import pyplot as plt1
u/[deleted] Dec 06 '20
https://stackoverflow.com/questions/14812342/matplotlib-has-no-attribute-pyplot
0
u/[deleted] Nov 29 '20
[deleted] — view deleted comment