当我调整浏览器窗口大小时,如何让我的桌子保持在同一位置?
我正在使用css:
import matplotlib.pyplot as plt
import matplotlib.animation as animation
import numpy as np
from collections import deque
from random import randint, randrange
def get_data():
'''returns a random amount of random integers'''
return [randrange(100) for _ in range(randint(20, 50))]
points = 200
xdata = np.linspace(-30, 0, points) # make the X x axis, in this case from -30 to 0
ydata = deque([0]*points, maxlen=points) # initialize the y data with 0's
fig = plt.figure()
ax1 = fig.add_subplot(1,1,1)
line, = ax1.plot(xdata, ydata, lw=2)
def run(*args):
ydata.extend(get_data()) # get and add data
line.set_ydata(ydata) # plot new data
plt.ylim(min(ydata), max(ydata)) # set limits (use if the data may go off the screen)
ani = animation.FuncAnimation(fig, run, interval=1000//20) # 20 Hz is 1000//20 ms interval
plt.show()
答案 0 :(得分:0)
没有足够的信息,但是可能没有意识到你做错了。
如果您在css中使用#<name>
,则需要将id=<name>
作为属性添加到html标记。
如果您希望所有表都使用该CSS,则需要删除#