我正在尝试对两个图进行编码,使一个图位于另一个图的下方。然而,我的代码不断将我的两个图相互对齐。这是我的代码:
import numpy as np
from scipy.integrate import odeint
from numpy import sin, cos, pi, array
import matplotlib
from matplotlib import rcParams
import matplotlib.pyplot as plt
from pylab import figure, axes, title, show
import xlsxwriter
plt.style.use('ggplot')
def deriv(z, t):
l = 0.25 #unextended length of the spring, in m
m = 0.25 #mass of the bob, in kg
k = 29.43 #spring constant, in Nm^-1
g = 9.81 #gravitational acceleration, in ms^-2
x, y, dxdt, dydt = z
dx2dt2 = …Run Code Online (Sandbox Code Playgroud)