Good day! I want to build a hyperbole with matplotlib, for example. There is the following code:
import matplotlib.pyplot as plt import pylab, math xmin = -200 xmax = 200 dx = 0.1 xlist = [float(x) for x in range(xmin,xmax)] ylist = [float(1/x) for x in range(xmin,xmax)] ax = plt.gca() ax.spines['right'].set_color('none') ax.spines['top'].set_color('none') ax.xaxis.set_ticks_position('bottom') ax.spines['bottom'].set_position(('data',0)) ax.yaxis.set_ticks_position('left') ax.spines['left'].set_position(('data',0)) plt.grid(True) plt.title('График функции ') pylab.plot(xlist,ylist) pylab.savefig('123.png') Example of work on the picture As you can see, there is a segment between the two branches of the function. I know that this is due to the fact that there is a value of the extreme points of the branches, and the raft connects them. But I do not need it, I need to get a normal schedule. If this schedule were always hyperbole, it would be normal. But this schedule can be any schedule with a gap. How to avoid this segment? I saw ways, but there were used additional packages (numpy), I do not want to pull them into this code [
]