0

I have created a scatterplot showing the poles of a function on the complex plane. To make it more clear and immediately visible where the poles are in relation to the origin I'd like to make the coordinate axes (the lines x=0 and y=0) thicker/blacker, is there any way to do that with matplotlib.

Bonus question: Can I make the lines thicker/blacker and have little arrowheads at the end.

Minimalistic example of how I've plotted it

import matplotlib.pyplot as plt
import numpy as np

poles = [1,0,-1+1j, -1-1j]
plt.scatter(np.real(poles),np.imag(poles),marker='x')
David
  • 179
  • 1
  • 1
  • 9
  • @DizietAsahi No, I want lines indicating x=0 and y=0, I don't want to make the border thicker – David Apr 06 '20 at 13:15
  • 1
    Oh wait, sloppy reading by me, I just read the top/accepted answer but the second one accomplishes what I want – David Apr 06 '20 at 13:20
  • How about ```plt.hlines(0, min(np.real(poles)), max(np.real(poles))``` and ```plt.vlines(0, min(np.imag(poles)), max(np.imag(poles))```? – Eric Truett Apr 06 '20 at 13:21

1 Answers1

1

Solved it with axhline and axvline like so:

import matplotlib.pyplot as plt
import numpy as np

fig = plt.figure()
ax = fig.add_subplot(111)

poles = [1,0,-1+1j, -1-1j]
ax.scatter(np.real(poles),np.imag(poles),marker='x')

ax.axhline(linewidth=1, color="k")
ax.axvline(linewidth=1, color="k")

plt.show()
David
  • 179
  • 1
  • 1
  • 9