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


Python pyplot.interactive方法代码示例

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


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

示例1: main

# 需要导入模块: from matplotlib import pyplot [as 别名]
# 或者: from matplotlib.pyplot import interactive [as 别名]
def main():
    import matplotlib.pyplot as plt
    from .pncparse import pncparse
    ifiles, options = pncparse(
        has_ofile=True, plot_options=True, interactive=False)
    if len(ifiles) != 1:
        raise IOError(
            'pncview can operate on only 1 file; user requested %d' %
            len(ifiles))
    ifile, = ifiles
    plt.interactive(True)
    for method_vars in options.plotcommands:
        pieces = method_vars.split(',')
        plotargs = [p for p in pieces if '=' not in p]
        plotkwds = [p for p in pieces if '=' in p]
        method, = plotargs[:1]
        vars = plotargs[1:]
        plotoptions = eval('OptionDict(outpath="%s",%s)' %
                           (options.outpath, ','.join(plotkwds)))
        print(plotoptions.logscale)
        plotwithopts(ifile, method, vars, plotoptions)
    plt.interactive(False)
    if len(options.plotcommands) == 0:
        pncview(ifile, options) 
开发者ID:barronh,项目名称:pseudonetcdf,代码行数:26,代码来源:pncview.py

示例2: plot_top

# 需要导入模块: from matplotlib import pyplot [as 别名]
# 或者: from matplotlib.pyplot import interactive [as 别名]
def plot_top(df):
    """Plot stocks based on total score.

    Args:
      df(pandas.DataFrame): Stock score pandas.DataFrame

    Returns:
      Matplotlib plot with stocks and scores (broken down by score id)

    """
    # Set styling
    plt.style.use("seaborn-darkgrid")
    plt.interactive(False)
    # Custom Font - Download Apple's SF fonts for this to work
    # Otherwise, should default to default font
    plt.rcParams["font.family"] = "sans-serif"
    plt.rcParams["font.sans-serif"] = "SF Pro Display"
    # Plot DataFrame as bar chart
    df.plot.bar()
    # Plot labels
    plt.ylabel("Score")
    plt.xlabel("Tickers")
    plt.title("Top {num} Stock Scores".format(num=len(df)))
    plt.show(block=True) 
开发者ID:jackmoody11,项目名称:stockscore,代码行数:26,代码来源:graph.py

示例3: set_mpl_interactive

# 需要导入模块: from matplotlib import pyplot [as 别名]
# 或者: from matplotlib.pyplot import interactive [as 别名]
def set_mpl_interactive():
    '''Ensure matplotlib is in interactive mode.'''
    import matplotlib.pyplot as plt

    if not plt.isinteractive():
        plt.interactive(True) 
开发者ID:spectralpython,项目名称:spectral,代码行数:8,代码来源:spypylab.py


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