无法弄清楚为什么matplotlib函数不适用于图形?

时间:2019-05-25 19:06:53

标签: python function matplotlib graphing

我正在从事一些研究工作,并获得了所需的图,但是无论我尝试了什么,轴标签都无法正常工作(plt.xlabel(),plt.ylabel(),ax .set_xlabel(),ax.set_ylabel())

here is the graph I'm working with

而且我也无法使用fig()函数水平拉伸我的图;我需要更轻松地查看线条,我认为这与事物的放置有关,但是我运气不好就把它们移到了

def simplot(self,filename=None,plot=True):

    fig = plt.figure(figsize=(10,4))
    ax = fig.add_subplot(111)
    ax.errorbar(self.data['bjd'], self.data['flux'],fmt='ko')

    if plot is True:
        x = self.data['bjd']
        y = self.data['flux']
        # fig = plt.figure(figsize=(10,4))
        # ax = fig.add_subplot(111)

        # plt.xlabel('BJD (Days)')
        # plt.ylabel('Flux (e-/s)')

        plt.plot(x,y,'o')
        ax.set_xlabel('BJD (Days)')
        ax.set_ylabel('Flux (e-/s)')

    return plot 

0 个答案:

没有答案
相关问题