我正在尝试绘制一个函数及其从pylatex派生的函数,它根本无法工作,并给出了该错误不是浮动的错误,我认为该错误是由于从sympy路由而来的,但是有任何想法会有所帮助。
import pylatex as pl
from pylatex.utils import bold, NoEscape
from pylatex.basic import NewPage
import numpy as np
import sympy as sp
import matplotlib as plt
import matplotlib.pyplot as pltt
x = sp.Symbol('x')
y1 = sp.sin(x)
y2 = y1.diff(x)
with doc.create(pl.Figure(position='h!')) as plot:
pltt.plot(y2,y1)
plt.axis([-2*np.pi,2*np.pi, -2, 2])