情节没有定义ipython?

时间:2014-05-30 13:03:10

标签: python

在ipython中使用它

def plotcorrected(self, conditions= 'all', strains= 'all'):
    # Plots the corrected fluorescence per cell for all strains in all conditions.
    '''
    S, t= self.d, self.t
    if conditions == 'all':
        cons= S.keys()
    else:
        cons= gu.makelist(conditions)
    for c in cons:
        if strains == 'all':
            strains=  S[c].keys()
        else:
            strains= gu.makelist(strains)
        for s in strains:
            if s != 'null' and s != 'WT':
                plt.figure()
                plt.plot(t, S[c][s]['mg'], '.-')
                plt.plot(t, S[c][s]['mg']+S[c][s]['sg'], 'k:', alpha=0.4)
                plt.plot(t, S[c][s]['mg']-S[c][s]['sg'], 'k:', alpha=0.4)
                plt.xlabel('time (hours)')
                plt.ylabel('corrected fluorescence')
                plt.title('corrected ' + s + ' in ' + c)
                plt.show()

但是当试图绘制ie plot(t, S['1%gal']['GAL10']['data'][:, 0], '.')时,它返回未定义情节

1 个答案:

答案 0 :(得分:3)

left out

import matplotlib.pyplot as plt

来自您粘贴的代码。