當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。