speedometer.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:core-framework 作者: RedhawkSDR 项目源码 文件源码
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()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号