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


Python FigureCanvasAgg.print_eps方法代码示例

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


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

示例1: save_plotSpectrum

# 需要导入模块: from matplotlib.backends.backend_agg import FigureCanvasAgg [as 别名]
# 或者: from matplotlib.backends.backend_agg.FigureCanvasAgg import print_eps [as 别名]
def save_plotSpectrum(y,Fs,image_name):
    """
    Plots a Single-Sided Amplitude Spectrum of y(t)
    """
    fig = Figure(linewidth=0.0)
    fig.set_size_inches(fig_width,fig_length, forward=True)
    Figure.subplots_adjust(fig, left = fig_left, right = fig_right, bottom = fig_bottom, top = fig_top, hspace = fig_hspace)
    n = len(y) # length of the signal

    _subplot = fig.add_subplot(2,1,1)        
    print "Fi"
    _subplot.plot(arange(0,n),y)
    xlabel('Time')
    ylabel('Amplitude')
    _subploti_2=fig.add_subplot(2,1,2)
    k = arange(n)
    T = n/Fs
    frq = k/T # two sides frequency range
    frq = frq[range(n/2)] # one side frequency range

    Y = fft(y)/n # fft computing and normalization
    Y = Y[range(n/2)]

    _subplot_2.plot(frq,abs(Y),'r') # plotting the spectrum
    xlabel('Freq (Hz)')
    ylabel('|Y(freq)|')
    print "here"
    canvas = FigureCanvasAgg(fig)
    if '.eps' in outfile_name:
        canvas.print_eps(outfile_name, dpi = 110)
    if '.png' in outfile_name:
        canvas.print_figure(outfile_name, dpi = 110)
开发者ID:FomkaV,项目名称:wifi-arsenal,代码行数:34,代码来源:non_wifi_interference_analysis.py

示例2: template_plotter

# 需要导入模块: from matplotlib.backends.backend_agg import FigureCanvasAgg [as 别名]
# 或者: from matplotlib.backends.backend_agg.FigureCanvasAgg import print_eps [as 别名]
def template_plotter(x_axis_label, y_axis_label,x_axes=[],x_ticks=[],title, outfile_name):
    fig = Figure(linewidth=0.0)
    fig.set_size_inches(fig_width,fig_length, forward=True)
    Figure.subplots_adjust(fig, left = fig_left, right = fig_right, bottom = fig_bottom, top = fig_top, hspace = fig_hspace)

    _subplot = fig.add_subplot(1,1,1)
    _subplot.boxplot(x_axis,notch=0,sym='+',vert=1, whis=1.5)    
    #_subplot.plot(x,y,color='b', linestyle='--', marker='o' ,label='labels')
    a =[i for i in range(1,len(x_ticks)+1)]
    _subplot.set_xticklabels(x_ticks)
    _subplot.set_xticks(a)
    labels=_subplot.get_xticklabels()
    for label in labels:
        label.set_rotation(30)
    _subplot.set_ylabel(y_axis_label,fontsize=36)
    _subplot.set_xlabel(x_axis_label)
    #_subplot.set_ylim()
    #_subplot.set_xlim()
    
    _subplot.set_title(title)
    _subplot.legend(loc='upper left',prop=LEGEND_PROP ,bbox_to_anchor=(0.5, -0.05))
    canvas = FigureCanvasAgg(fig)
    if '.eps' in outfile_name:
        canvas.print_eps(outfile_name, dpi = 110)
    if '.png' in outfile_name:
        canvas.print_figure(outfile_name, dpi = 110)
    outfile_name='EpsilonvsMTU.pdf'
    if '.pdf' in outfile_name:
        canvas.print_figure(outfile_name, dpi = 110)
开发者ID:abnarain,项目名称:utils,代码行数:31,代码来源:template.py

示例3: print_figure

# 需要导入模块: from matplotlib.backends.backend_agg import FigureCanvasAgg [as 别名]
# 或者: from matplotlib.backends.backend_agg.FigureCanvasAgg import print_eps [as 别名]
def print_figure(fig, destination_directory, filename, extension):
    canvas = FigureCanvasAgg(fig)
    if extension == '.png':
        canvas.print_figure(os.path.join(destination_directory, \
            filename + extension), dpi = 110)
    elif extension == '.eps':
        canvas.print_eps(os.path.join(destination_directory,\
            filename + extension), dpi = 110)
开发者ID:bvattikonda,项目名称:twitter-advertising,代码行数:10,代码来源:earnings_on_spntw_graph.py

示例4: print_image

# 需要导入模块: from matplotlib.backends.backend_agg import FigureCanvasAgg [as 别名]
# 或者: from matplotlib.backends.backend_agg.FigureCanvasAgg import print_eps [as 别名]
def print_image(x,y,x2,y2,outfile_name):
    fig = Figure(linewidth=0.0)
    fig.set_size_inches(fig_width,fig_length, forward=True)
    Figure.subplots_adjust(fig, left = fig_left, right = fig_right, bottom = fig_bottom, top = fig_top, hspace = fig_hspace)
    _subplot = fig.add_subplot(2,1,1)
    _subplot.set_title('Detection of Source generating non-wifi Interference')
    _subplot.plot(x,y,color='b')
    _subplot.set_xlabel('Time')
    _subplot.set_ylabel('Error Counts')
#    _subplot.set_ylim([0,1])
    _subplot2=fig.add_subplot(2,1,2)
    _subplot2.plot(x2,y2,color='r') # plotting the spectrum                     
    _subplot2.set_ylabel('Entropy')
    _subplot2.set_xlabel('Time')
    _subplot2.set_ylim([0,1])
    canvas = FigureCanvasAgg(fig)
    if '.eps' in outfile_name:
        canvas.print_eps(outfile_name, dpi = 110)
    if '.png' in outfile_name:
        canvas.print_figure(outfile_name, dpi = 110)
开发者ID:FomkaV,项目名称:wifi-arsenal,代码行数:22,代码来源:non_wifi_interference_analysis.py

示例5: len

# 需要导入模块: from matplotlib.backends.backend_agg import FigureCanvasAgg [as 别名]
# 或者: from matplotlib.backends.backend_agg.FigureCanvasAgg import print_eps [as 别名]
    _subplot.set_ylabel('Delay(mean) between frames in microseconds')            
    '''
    g=[]
    aray=[]
    for i in z : 
        g.append(str(i))
    _subplot.set_xticks(ind+width)
    _subplot.set_xticklabels(g)
    #_subplot.legend(loc=0, prop=LEGEND_PROP, bbox_to_anchor=(0.1,- 0.05), scatterpoints=1)
    aray.append(rects[0])
    _subplot.set_yscale('log')
    #legend_elem=file.strip('pickle.')
    #legend_elem=legend_elem.strip('^rate_')
    #legend.append(legend_elem)
    #print legend
    #print "========"
    #print aray
    #if len(aray) > 0:
     #   _subplot.legend(aray,legend)#,bbox_to_anchor=(0.1,- 0.05))
    labels = _subplot.get_xticklabels()
    for label in labels:
        label.set_rotation(30)


    canvas = FigureCanvasAgg(fig)
    if '.eps' in outfile_name:
        canvas.print_eps(outfile_name, dpi = 110)
    if '.png' in outfile_name:
        canvas.print_figure(outfile_name, dpi = 110)

开发者ID:FomkaV,项目名称:wifi-arsenal,代码行数:31,代码来源:delay-barplot.py

示例6: save_to_eps

# 需要导入模块: from matplotlib.backends.backend_agg import FigureCanvasAgg [as 别名]
# 或者: from matplotlib.backends.backend_agg.FigureCanvasAgg import print_eps [as 别名]
def save_to_eps(fig, output_file):
    fig.set_facecolor("#FFFFFF")
    canvas = FigureCanvasAgg(fig)
    canvas.print_eps(output_file, dpi=72)
开发者ID:jbonaiuto,项目名称:rdmd,代码行数:6,代码来源:utils.py

示例7: FigureCanvasAgg

# 需要导入模块: from matplotlib.backends.backend_agg import FigureCanvasAgg [as 别名]
# 或者: from matplotlib.backends.backend_agg.FigureCanvasAgg import print_eps [as 别名]
temp = [d.temp for d in data]
lux = [d.lux for d in data]

fig = matplotlib.figure.Figure()
hplot = fig.add_subplot(3,1,1)
tplot = fig.add_subplot(3,1,2)
lplot = fig.add_subplot(3,1,3)

hplot.plot_date(dates, hum)
tplot.plot_date(dates, temp)
lplot.plot_date(dates, lux)

hplot.xaxis.set_major_locator(matplotlib.dates.DayLocator())
hplot.xaxis.set_minor_locator(matplotlib.dates.HourLocator(numpy.arange(0,24,1)))
hplot.xaxis.set_major_formatter(matplotlib.dates.DateFormatter('%Y-%m-%d'))
tplot.xaxis.set_major_locator(matplotlib.dates.DayLocator())
tplot.xaxis.set_minor_locator(matplotlib.dates.HourLocator(numpy.arange(0,24,1)))
tplot.xaxis.set_major_formatter(matplotlib.dates.DateFormatter('%Y-%m-%d'))
lplot.xaxis.set_major_locator(matplotlib.dates.DayLocator())
lplot.xaxis.set_minor_locator(matplotlib.dates.HourLocator(numpy.arange(0,24,1)))
lplot.xaxis.set_major_formatter(matplotlib.dates.DateFormatter('%Y-%m-%d'))

canvas = FigureCanvasAgg(fig)
canvas.print_eps(output, dpi=110)

of = open('export.csv', 'w')
of.write('Humidity,Temperature,Luminosity,Date\n')
for d in data:
    of.write('%.2f,%.2f,%d,%s\n' % (d.hum, d.temp, d.lux / 20000.0, d.time.strftime('%m/%d/%Y %H:%M')))
of.close()
开发者ID:kevincwebb,项目名称:beaglebone-lemon-trees,代码行数:32,代码来源:hum_temp_light.py

示例8: Rectangle

# 需要导入模块: from matplotlib.backends.backend_agg import FigureCanvasAgg [as 别名]
# 或者: from matplotlib.backends.backend_agg.FigureCanvasAgg import print_eps [as 别名]
    pArr = []
    data_x = np.arange(0.0, 100.0, 1)
    data_y = np.arange(0.0, 100.0, 1)
    for alab in legendColors:
        # p = Rectangle((0, 0), 1, 1, fc="r")
        # l = Line2D(ax, data_x, data_y , color=plotcolors[alab % len(plotcolors)], ls='-', lw=2)
        l = Rectangle((0, 0), 1, 1, fc=plotcolors[alab % len(plotcolors)])
        pArr.append(l)
        #pArr.append(  ax.plot(data_x, data_y, color=plotcolors[colorParams % len(plotcolors)], linestyle='-', marker='', markerfacecolor='None', markeredgecolor='#000000' )  )
    legend(pArr, legendText)
    canvas = FigureCanvas(fig)
    targetFile = targetList[0]
    graphicsFilename = targetFile
    graphicsFilename = graphicsFilename.replace('.txt','')
    #canvas.print_eps(graphicsFilename+'.svg')
    canvas.print_eps(graphicsFilename+'.eps')
    #canvas.print_pdf(graphicsFilename+'.pdf')
    canvas.print_png(graphicsFilename+'.png')
    plt.close(fig)

# for each file sent as argument create a plot
for filidx in range(0,len(targetList)):
    targetFile = targetList[filidx]
    # read the x values
    if (os.path.exists(targetFile) ):
        # read the y values
        data_y = []
        data_x = []
        t = 0
        if (dtfileFlag and os.path.exists(dtfileParams)):
            file_x = open(dtfileParams,'rU')
开发者ID:OpenSourceBrain,项目名称:Thalamocortical,代码行数:33,代码来源:plotDat.py

示例9: activity

# 需要导入模块: from matplotlib.backends.backend_agg import FigureCanvasAgg [as 别名]
# 或者: from matplotlib.backends.backend_agg.FigureCanvasAgg import print_eps [as 别名]

p.set_ylabel('Simulation time for 1 sec of net activity (sec)', fontsize=14)

p.set_xlabel('Number of processors', fontsize=14)


lines[0].set_label('Legion')
lines[2].set_label('PadraigPC')
lines[4].set_label('Bernal')
lines[6].set_label('Matthau')
lines[8].set_label('Lemmon')

legend()

fig.set_figheight(8)
fig.set_figwidth(12)

#plt.print_figure()

canvas = FigureCanvas(fig)

canvas.print_eps('Performance.eps')

print dir(fig)


plt.show()


开发者ID:OpenSourceBrain,项目名称:NSGPortalShowcase,代码行数:29,代码来源:perf_ml.py

示例10: getXvals

# 需要导入模块: from matplotlib.backends.backend_agg import FigureCanvasAgg [as 别名]
# 或者: from matplotlib.backends.backend_agg.FigureCanvasAgg import print_eps [as 别名]
    getXvals(times_Lm_ideal),
    getYvals(times_Lm_ideal),
    "m:",
)


p.set_ylabel("Simulation time for 1 sec of net activity (sec)", fontsize=14)

p.set_xlabel("Number of processors", fontsize=14)


lines[0].set_label("Lemmon")
lines[2].set_label("Matthau")
lines[4].set_label("Both")

legend()

fig.set_figheight(8)
fig.set_figwidth(12)

# plt.print_figure()

canvas = FigureCanvas(fig)

canvas.print_eps("Performance.eps")

# print dir(fig)


plt.show()
开发者ID:OpenSourceBrain,项目名称:Thalamocortical,代码行数:32,代码来源:perf_ml.py


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