У меня есть этот код:
import numpy as np
%matplotlib notebook
import matplotlib.pyplot as plt
import ipywidgets as widgets
from maux import init_subplot, smart_ticklabel
from mtest import true_false_test
plt.rcParams.update({'figure.max_open_warning': 0})
X = np.linspace(-np.pi, np.pi, 2*4*100+1)
fig, (ax1, ax2) = plt.subplots(nrows=2, ncols=1, sharex=True, sharey=True)
fig.set_size_inches(9, 10)
init_subplot(ax1)
xtick_numerators = range(-6, 6+1)
ax1.set_xticks([n * np.pi / 6 for n in xtick_numerators])
ax1.set_xticklabels([smart_ticklabel(n, r"\pi", 6) for n in xtick_numerators])
ax1.set_ylim(-3.4, 4.4)
def df(X): return ((2 * np.sin(2*X)*np.cos(2*X)) / np.abs(np.sin(2*X))) +1
dX = X
ax1.plot(dX, df(dX), label="derivation")
fig.show()
, и проблема в том, что на графике есть линии, которых не должно быть на оси x - например, в точках -2 / π;0;π / 2.Я не знаю, как их удалить.Есть идеи как это сделать?