当前位置: 首页>>代码示例>>Python>>正文


Python NavigationToolbar2QT.forward方法代码示例

本文整理汇总了Python中matplotlib.backends.backend_qt5agg.NavigationToolbar2QT.forward方法的典型用法代码示例。如果您正苦于以下问题:Python NavigationToolbar2QT.forward方法的具体用法?Python NavigationToolbar2QT.forward怎么用?Python NavigationToolbar2QT.forward使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在matplotlib.backends.backend_qt5agg.NavigationToolbar2QT的用法示例。


在下文中一共展示了NavigationToolbar2QT.forward方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: Calibrlogger

# 需要导入模块: from matplotlib.backends.backend_qt5agg import NavigationToolbar2QT [as 别名]
# 或者: from matplotlib.backends.backend_qt5agg.NavigationToolbar2QT import forward [as 别名]

#.........这里部分代码省略.........
            original_head_style = '--'
        else:
            logger_line_style = '-'
            original_head_style = '--'

        logger_time_list = self.timestring_list_to_time_list(self.a_recarray_to_timestring_list(self.level_masl_ts))
        self.plot_recarray(self.axes, self.level_masl_ts, obsid + ru(QCoreApplication.translate('Calibrlogger', ' adjusted logger')), logger_line_style, picker=5, time_list=logger_time_list, zorder=10, color='#ff7f0eff')

        #Plot the original head_cm
        if self.plot_logger_head.isChecked():
            self.plot_recarray(self.axes, self.head_ts_for_plot, obsid + ru(QCoreApplication.translate('Calibrlogger', ' original logger head')), original_head_style, picker=5, time_list=logger_time_list, zorder=5, color='#c1c1c1ff')

        """ Finish plot """
        self.axes.grid(True)
        self.axes.yaxis.set_major_formatter(tick.ScalarFormatter(useOffset=False, useMathText=False))
        self.calibrplotfigure.autofmt_xdate()
        self.axes.set_ylabel(ru(QCoreApplication.translate('Calibrlogger', 'Level (masl)')))  #This is the method that accepts even national characters ('åäö') in matplotlib axes labels
        self.axes.set_title(ru(QCoreApplication.translate('Calibrlogger', 'Plot for ')) + str(obsid))  #This is the method that accepts even national characters ('åäö') in matplotlib axes labels
        for label in self.axes.xaxis.get_ticklabels():
            label.set_fontsize(8)
        for label in self.axes.yaxis.get_ticklabels():
            label.set_fontsize(8)

        self.calibrplotfigure.tight_layout()

        if self.axes.legend_ is None:
            leg = self.axes.legend()

        self.canvas.draw()
        #plt.close(self.calibrplotfigure)#this closes reference to self.calibrplotfigure
        self.calib_help.setText("")

        if last_used_obsid == self.obsid:
            self.mpltoolbar.forward()
        else:
            #Clear choices
            self.reset_settings()
            self.mpltoolbar.update()

        utils.stop_waiting_cursor()

    @fn_timer
    def plot_recarray(self, axes, a_recarray, lable, line_style, picker=5, time_list=None, zorder=None, markersize=None, color=None):
        """ Plots a recarray to the supplied axes object """
        if time_list is None:
            time_list = self.timestring_list_to_time_list(self.a_recarray_to_timestring_list(a_recarray))
        self.plot_the_recarray(axes, time_list, a_recarray, lable, line_style, picker=picker, zorder=zorder, markersize=markersize, color=color)
        
    @fn_timer
    def a_recarray_to_timestring_list(self, a_recarray):
        return [a_recarray.date_time[idx] for idx in range(len(a_recarray))]
        
    @fn_timer
    def timestring_list_to_time_list(self, timestring_list):
        """Get help from function datestr2num to get date and time into float"""
        return datestr2num(timestring_list)
        
    @fn_timer
    def plot_the_recarray(self, axes, time_list, a_recarray, lable, line_style, picker=5, zorder=None, markersize=None, color=None):
        kwargs = {'label': lable, 'picker':picker}
        if zorder is not None:
            kwargs['zorder'] = zorder
        if markersize is not None:
            kwargs['markersize'] = markersize
        if color is not None:
            kwargs['color'] = color
开发者ID:jkall,项目名称:qgis-midvatten-plugin,代码行数:70,代码来源:wlevels_calc_calibr.py


注:本文中的matplotlib.backends.backend_qt5agg.NavigationToolbar2QT.forward方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。