我正在尝试使用 matplotlib 和 numpy 来绘制图表,但不断遇到此错误:
MatplotlibDeprecationWarning: Support for FigureCanvases without a required_interactive_framework attribute was deprecated in Matplotlib 3.6 and will be removed two minor releases later.
plt.plot(cache_sizes, hit_rates[i])
Run Code Online (Sandbox Code Playgroud)
知道如何解决吗?
这是代码:
#!/usr/bin/env python3
import os
import subprocess
import matplotlib.pyplot as plt
import numpy as np
# cache_sizes = np.arange(0, 120, 20)
cache_sizes = np.arange(1, 5)
policies = ["FIFO", "LRU", "OPT", "UNOPT", "RAND", "CLOCK"]
# these were acheived after running `run.sh`
hit_rates = [
# FIFO
[45.03, 83.08, 93.53, 97.42],
# LRU …Run Code Online (Sandbox Code Playgroud)