def __init__(self, period):
# Quiet the warning about GTK Tooltip deprecation
import warnings
with warnings.catch_warnings():
warnings.filterwarnings('ignore', category=DeprecationWarning)
self.figure = pyplot.figure()
self.figure.canvas.set_window_title('REDHAWK Speedometer')
# Create a line graph of throughput over time
self.axes = self.figure.add_subplot(111)
self.axes.set_xlabel('Time')
self.axes.set_ylabel('Throughput (Bps)')
self.x = []
self.y = []
self.line, = self.axes.plot(self.x, self.y)
self.axes.set_xlim(xmax=period)
self.figure.subplots_adjust(bottom=0.2)
sliderax = self.figure.add_axes([0.2, 0.05, 0.6, 0.05])
min_size = 1024
max_size = 8*1024*1024
default_size = 1*1024*1024
self.slider = matplotlib.widgets.Slider(sliderax, 'Transfer size', min_size, max_size,
default_size, '%.0f')
self.figure.show()
评论列表
文章目录