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


Python FontProperties.set_family方法代码示例

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


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

示例1: main

# 需要导入模块: from matplotlib.font_manager import FontProperties [as 别名]
# 或者: from matplotlib.font_manager.FontProperties import set_family [as 别名]
def main():
    dataset = VOCBboxDataset(year='2007', split='test')
    models = [
        ('Faster R-CNN', FasterRCNNVGG16(pretrained_model='voc07')),
        ('SSD300', SSD300(pretrained_model='voc0712')),
        ('SSD512', SSD512(pretrained_model='voc0712')),
    ]
    indices = [29, 301, 189, 229]

    fig = plot.figure(figsize=(30, 30))
    for i, idx in enumerate(indices):
        for j, (name, model) in enumerate(models):
            img, _, _ = dataset[idx]
            bboxes, labels, scores = model.predict([img])
            bbox, label, score = bboxes[0], labels[0], scores[0]

            ax = fig.add_subplot(
                len(indices), len(models), i * len(models) + j + 1)
            vis_bbox(
                img, bbox, label, score,
                label_names=voc_bbox_label_names, ax=ax
            )

            # Set MatplotLib parameters
            ax.set_aspect('equal')
            if i == 0:
                font = FontProperties()
                font.set_family('serif')
                ax.set_title(name, fontsize=35, y=1.03, fontproperties=font)
            plot.axis('off')
            plot.tight_layout()

    plot.show()
开发者ID:gwtnb,项目名称:chainercv,代码行数:35,代码来源:visualize_models.py

示例2: plot_markers

# 需要导入模块: from matplotlib.font_manager import FontProperties [as 别名]
# 或者: from matplotlib.font_manager.FontProperties import set_family [as 别名]
def plot_markers(data, x_base, name, map, xoff_sgn, width, off_fac,
                 markersize):
    maxD = 0
    ds = {}
    used = []
    font = FontProperties()
    font.set_family('sans-serif')
    font.set_size(10)
    for (kind, subkind, dimval) in data:
        try:
            symb, lab = map[kind][subkind]
        except KeyError:
            raise KeyError("Invalid key for %s symbols"%name)
        used.append((kind, subkind))
        try:
            ds[dimval] += 1
            x_off = xoff_sgn*width*off_fac*(ds[dimval]-1)
        except KeyError:
            ds[dimval] = 1
            x_off = 0
        plot([x_base+x_off], [dimval], symb, markersize=markersize)
        # hack tweaks
    ##            if lab=='C':
    ##                x_off -= width/15
        if lab=='A':
            x_off += width/30
        text(x_base+x_off-width*.15, dimval-width*2., lab,
             fontproperties=font)
        if dimval > maxD:
            maxD = dimval
    return ds, maxD, used
开发者ID:F-A,项目名称:pydstool,代码行数:33,代码来源:prep_boxplot.py

示例3: plot_triangle

# 需要导入模块: from matplotlib.font_manager import FontProperties [as 别名]
# 或者: from matplotlib.font_manager.FontProperties import set_family [as 别名]
    def plot_triangle(self):
        
        font_ = FontProperties()
        font_.set_family('sans-serif')
        font_.set_weight('normal')
        font_.set_style('italic')
        self.fig = figure()
        alpha = 0.8
        alphal = 0.5
        third_range = np.linspace(-0.0277, 0.21, 10000)
        second_upper = 2*third_range + 2.0/9.0
        plot(third_range, second_upper, color='k', alpha=alphal)
        
        second_right = 1.5*(abs(third_range)*4.0/3.0)**(2.0/3.0)
        plot(third_range, second_right, color='k', alpha=alphal)
        connectionstyle="arc3,rad=.1"
        lw = 0.5
        plot(np.array([0.0, 0.0]), np.array([0.0, 2.0/9.0]), color='k', alpha=alphal)
        gca().annotate(r'Isotropic limit', xy=np.array([0, 0]), xytext=np.array([0.05, 0.02]), fontproperties=font_, rotation=0, alpha=alpha, arrowprops=dict(arrowstyle="->", connectionstyle=connectionstyle, lw=lw))
        gca().annotate(r'Plane strain', xy=np.array([0, 1.0/9.0/2]), xytext=np.array([0.07, 0.07]), fontproperties=font_, rotation=0, alpha=alpha, arrowprops=dict(arrowstyle="->", connectionstyle=connectionstyle, lw=lw))
        gca().annotate(r'One component limit', xy=np.array([third_range[-1], second_upper[-1]]), xytext=np.array([0.00, 0.6]), fontproperties=font_, rotation=0, alpha=alpha, arrowprops=dict(arrowstyle="->", connectionstyle=connectionstyle, lw=lw))
        gca().annotate(r'Axisymmetric contraction', xy=np.array([third_range[1000/2], second_right[1000/2]]), xytext=np.array([0.09, 0.12]), fontproperties=font_, rotation=0, alpha=alpha, arrowprops=dict(arrowstyle="->", connectionstyle=connectionstyle, lw=lw))
        gca().annotate(r'Two component axisymmetric', xy=np.array([third_range[0], second_right[0]]), xytext=np.array([0.11, 0.17]), fontproperties=font_, rotation=0, alpha=alpha, arrowprops=dict(arrowstyle="->", connectionstyle=connectionstyle, lw=lw))
        gca().annotate(r'Two component plane strain', xy=np.array([0, 2.0/9.0]), xytext=np.array([0.13, 0.22]), fontproperties=font_, rotation=0, alpha=alpha, arrowprops=dict(arrowstyle="->", connectionstyle=connectionstyle, lw=lw))
        gca().annotate(r'Axisymmetric expansion', xy=np.array([third_range[4000], second_right[4000]]), xytext=np.array([0.15, 0.27]), fontproperties=font_, rotation=0, alpha=alpha, arrowprops=dict(arrowstyle="->", connectionstyle=connectionstyle, lw=lw))
        gca().annotate(r'Two component', xy=np.array([third_range[6000], second_upper[6000]]), xytext=np.array([0.05, 0.5]), fontproperties=font_, rotation=0, alpha=alpha, arrowprops=dict(arrowstyle="->", connectionstyle=connectionstyle, lw=lw))


        self.ax = gca()
        xlim(-0.05, 0.3)
        ylim(0.0, 0.7)
        grid(False)
        gca().axis('off')
        gcf().patch.set_visible(False)
        tight_layout()
开发者ID:anandpratap,项目名称:anisotropy_maps,代码行数:37,代码来源:maps.py

示例4: ageGrade_hist

# 需要导入模块: from matplotlib.font_manager import FontProperties [as 别名]
# 或者: from matplotlib.font_manager.FontProperties import set_family [as 别名]
def ageGrade_hist(results,title=None,style='bmh'):
    '''
    Draw an histogram of the Age Grade results with basic stats added in the corner
    '''
    # reset style first (if style has been changed before running the script)
    plt.style.use('classic')
    plt.style.use(style)
    plt.style.use(r'.\large_font.mplstyle')
        
    fig, ax = plt.subplots(figsize=(10,8))
    ax.hist(results['Age Grade']*100,bins=np.arange(0,100,5),color='#A60628')
    #ax.set_xlim(15,60)
    ax.set_xlabel('Age Grade %',size='x-large')
    #ax.set_ylim(0,40)
    ax.set_ylabel('Count',size='x-large')
    plt.title(title)
    
    # add stats in a box
    stats = results['Age Grade'].describe()
    stats.iloc[1:]=stats.iloc[1:]*100
    stats_text = "Count  = {:.0f}\nMean   = {:.1f}%\nMedian = {:.1f}%" +\
                "\nMin    = {:.1f}%\nMax    = {:.1f}%"
    stats_text = stats_text.format(stats['count'],
                                   stats['mean'],stats['50%'],
                                   stats['min'],stats['max'])
    font0 = FontProperties()
    font0.set_family('monospace')
    ax.text(0.72,0.75,stats_text,fontsize=14,fontproperties=font0,
            bbox=dict(facecolor='white'),transform=ax.transAxes)
开发者ID:jobar8,项目名称:parkrun,代码行数:31,代码来源:parkrun.py

示例5: make_legend

# 需要导入模块: from matplotlib.font_manager import FontProperties [as 别名]
# 或者: from matplotlib.font_manager.FontProperties import set_family [as 别名]
def make_legend(labels, colors, output_file):
    """ Hack to generate a legend as a separate image.  A dummy plot
        is created in one figure, and its legend gets saved to an
        output file.

        Inputs:
        labels - text labels for the legend
        colors - list of colors for the legend (same length as labels)
        output_file - filename for the resulting output figure

        Outputs:
        (None - output figure is written to output_file)

    """
    if len(labels) != len(colors):
        raise ValueError("Lists of labels and colors "
                         " should have the same length")
    fig = plt.figure()
    font_prop = FontProperties()
    font_prop.set_size('xx-large')
    font_prop.set_family('sans-serif')
    seperate_legend = plt.figure(figsize=(5, 3.5))
    ax = fig.add_subplot(111)
    N = len(labels)
    # Make a dummy pie chart so we can steal its legend
    wedges, texts = ax.pie([100/N]*N, colors=colors)
    seperate_legend.legend(wedges, labels, 'center',
                           prop=font_prop, frameon=False)
    seperate_legend.savefig(output_file)
开发者ID:ETaSky,项目名称:American-Gut,代码行数:31,代码来源:plots.py

示例6: format_plot

# 需要导入模块: from matplotlib.font_manager import FontProperties [as 别名]
# 或者: from matplotlib.font_manager.FontProperties import set_family [as 别名]
def format_plot(axes, xlim=None, ylim=None, xlabel='', ylabel=''):
    '''format 2d-plot black and with with times legends 
    '''
    #-------------------------------------------------------------------
    # configure the style of the font to be used for labels and ticks
    #-------------------------------------------------------------------
    #
    from matplotlib.font_manager import FontProperties
    font = FontProperties()
    font.set_name('Script MT')
    font.set_family('serif')
    font.set_style('normal')
#    font.set_size('small')
    font.set_size('large')
    font.set_variant('normal')
    font.set_weight('medium')
    
    if xlim != None and ylim != None:
        axes.axis([0, xlim, 0., ylim], fontproperties=font)

    # format ticks for plot
    #
    locs, labels = axes.xticks()
    axes.xticks(locs, map(lambda x: "%.0f" % x, locs), fontproperties=font)
    axes.xlabel(xlabel, fontproperties=font)

    locs, labels = axes.yticks()
    axes.yticks(locs, map(lambda x: "%.0f" % x, locs), fontproperties=font)
    axes.ylabel(ylabel, fontproperties=font)
开发者ID:sarosh-quraishi,项目名称:simvisage,代码行数:31,代码来源:show_results.py

示例7: time_hist

# 需要导入模块: from matplotlib.font_manager import FontProperties [as 别名]
# 或者: from matplotlib.font_manager.FontProperties import set_family [as 别名]
def time_hist(results,title=None,style='bmh'):
    '''
    Draw an histogram of the time results with basic stats added in the corner
    '''
    # reset style first (if style has been changed before running the script)
    plt.style.use('classic')
    plt.style.use(style)
    plt.style.use(r'.\large_font.mplstyle')
        
    fig, ax = plt.subplots(figsize=(10,8))
    ax.hist(results['Time'],bins=range(15,61))
    ax.set_xlim(15,60)
    ax.set_xlabel('Time (min)',size='x-large')
    ax.set_ylim(0,40)
    ax.set_ylabel('Count',size='x-large')
    plt.title(title)
    
    # add stats in a box in the corner
    stats = results['Time'].describe()
    stats_text = "Count  = {:.0f}\nMean   = {}\nMedian = {}\nMin    = {}\nMax    = {}".format(
                stats['count'],
                minutes_to_timeString(stats['mean']),
                minutes_to_timeString(stats['50%']),
                minutes_to_timeString(stats['min']),
                minutes_to_timeString(stats['max']))
                
    font0 = FontProperties()
    font0.set_family('monospace')
    ax.text(47,30,stats_text,fontsize=14,fontproperties=font0,bbox=dict(facecolor='white'))
开发者ID:jobar8,项目名称:parkrun,代码行数:31,代码来源:parkrun.py

示例8: plot_basics

# 需要导入模块: from matplotlib.font_manager import FontProperties [as 别名]
# 或者: from matplotlib.font_manager.FontProperties import set_family [as 别名]
def plot_basics(data, data_inst, fig, units):
    '''
    This function is the main plotting function. Adapted from Newman's powerlaw package.
    '''
    import pylab
    pylab.rcParams['xtick.major.pad']='8'
    pylab.rcParams['ytick.major.pad']='8'
    pylab.rcParams['font.sans-serif']='Arial'

    from matplotlib import rc
    rc('font', family='sans-serif')
    rc('font', size=10.0)
    rc('text', usetex=False)

    from matplotlib.font_manager import FontProperties

    panel_label_font = FontProperties().copy()
    panel_label_font.set_weight("bold")
    panel_label_font.set_size(12.0)
    panel_label_font.set_family("sans-serif")

    n_data = 1
    n_graphs = 4
    from powerlaw import plot_pdf, Fit, pdf
    ax1 = fig.add_subplot(n_graphs,n_data,data_inst)
    x, y = pdf(data, linear_bins=True)
    ind = y>0
    y = y[ind]
    x = x[:-1]
    x = x[ind]
    ax1.scatter(x, y, color='r', s=.5, label='data')
    plot_pdf(data[data>0], ax=ax1, color='b', linewidth=2, label='PDF')
    from pylab import setp
    setp( ax1.get_xticklabels(), visible=False)
    plt.legend(loc = 'bestloc')

    ax2 = fig.add_subplot(n_graphs,n_data,n_data+data_inst, sharex=ax1)
    plot_pdf(data[data>0], ax=ax2, color='b', linewidth=2, label='PDF')
    fit = Fit(data, discrete=True)
    fit.power_law.plot_pdf(ax=ax2, linestyle=':', color='g',label='w/o xmin')
    p = fit.power_law.pdf()

    ax2.set_xlim(ax1.get_xlim())
    fit = Fit(data, discrete=True,xmin=3)
    fit.power_law.plot_pdf(ax=ax2, linestyle='--', color='g', label='w xmin')
    from pylab import setp
    setp(ax2.get_xticklabels(), visible=False)
    plt.legend(loc = 'bestloc')

    ax3 = fig.add_subplot(n_graphs,n_data,n_data*2+data_inst)#, sharex=ax1)#, sharey=ax2)
    fit.power_law.plot_pdf(ax=ax3, linestyle='--', color='g',label='powerlaw')
    fit.exponential.plot_pdf(ax=ax3, linestyle='--', color='r',label='exp')
    fit.plot_pdf(ax=ax3, color='b', linewidth=2)

    ax3.set_ylim(ax2.get_ylim())
    ax3.set_xlim(ax1.get_xlim())
    plt.legend(loc = 'bestloc')
    ax3.set_xlabel(units)
开发者ID:irisyupingren,项目名称:TSnet,代码行数:60,代码来源:textnetwork.py

示例9: darkcurrent_channel_analyse

# 需要导入模块: from matplotlib.font_manager import FontProperties [as 别名]
# 或者: from matplotlib.font_manager.FontProperties import set_family [as 别名]
def darkcurrent_channel_analyse(directory):
    hfont = {'family':'serif', 'fontsize': 12}

    cal_dict = sort_ibsen_by_int(directory)
    for key, val in sorted(cal_dict.items()):
        plt.plot(val['darkcurrent']['wave'], val['darkcurrent']['mean'], label='%1.f' % key)
    plt.xlabel(r'Wavelength $\lambda$ [nm]', **hfont)
    plt.ylabel(r'Signal [DN]', **hfont)

    fontP = FontProperties()
    fontP.set_family('serif')
    fontP.set_size('small')
    legend = plt.legend(loc=0, ncol=1, prop = fontP,fancybox=True,
                        shadow=False,title='Integration Times [ms]',bbox_to_anchor=(1.0, 1.0))
    #plt.setp(legend.get_title(),fontsize='small')
    plt.tight_layout()
    plt.show()

    plt.plot(cal_dict[5]['darkcurrent']['wave'], cal_dict[5]['reference']['mean'], label='Mean')
    plt.plot(cal_dict[5]['darkcurrent']['wave'], cal_dict[5]['darkcurrent']['mean'], label='Mean')
    plt.plot(cal_dict[5]['darkcurrent']['wave'], cal_dict[5]['darkcurrent']['data'], alpha=0.05)
    plt.plot(cal_dict[5]['darkcurrent']['wave'], cal_dict[5]['reference']['data'], alpha=0.05)
    plt.xlabel(r'Wavelength $\lambda$ [nm]', **hfont)
    plt.ylabel(r'Signal [DN]', **hfont)
    plt.show()

    sorted_keys = sorted(cal_dict.keys()) #[4:-4]
    tmp_channels = range(len(cal_dict[sorted_keys[0]]['darkcurrent']['wave']))
    noise_dict = dict()
    #tmp_channels = np.delete(tmp_channels, [187, 258, 265, 811])794
    gs = gridspec.GridSpec(2, 2)
    ax1 = plt.subplot(gs[0, :])
    ax2 = plt.subplot(gs[1, :])
    IntTimes = np.array(sorted_keys)
    noise = np.array([])

    dark_tmp = cal_dict[110]['darkcurrent']['mean']
    #ax1.plot( dark_tmp, '+')
    print(np.where(dark_tmp > 2361 ))

    for channel in tmp_channels:
        noise_dict[channel] = dict()
        dark = np.array([cal_dict[key]['darkcurrent']['mean'][channel] for key in sorted_keys])
        noise_dict[channel]['dark'] = dark
        coeffs_dark = np.polyfit(sorted_keys, dark, deg=1)

        noise = np.append(noise, coeffs_dark[1])
        ax1.plot(IntTimes, dark, '+')

    #ax1.plot(IntTimes, noise_dict[258]['dark'])
    ax2.plot(tmp_channels, noise)
    ax1.set_xlabel('Integration Time [ms]', **hfont)
    ax2.set_xlabel(r'Wavelength $\lambda$ [nm]', **hfont)
    ax1.set_ylabel('Signal [DN]', **hfont)
    ax2.set_ylabel('Signal [DN]', **hfont)
    plt.tight_layout()
    plt.show()
开发者ID:ZidCode,项目名称:ibsen_eval,代码行数:59,代码来源:tmp_nonlinear_check.py

示例10: label

# 需要导入模块: from matplotlib.font_manager import FontProperties [as 别名]
# 或者: from matplotlib.font_manager.FontProperties import set_family [as 别名]
 def label(lats, lons,  text):
    #y = xy[1] - 0.15 # shift y-value for label so that it's below the artist   
    lons_label = (np.max(lons)+np.min(lons)) / 2
    lats_label = (np.max(lats) + np.min(lats)) / 2
    x, y = (lons_label, lats_label ) 
    #plt.text(x, y, text, color='#262626', ha="center", va="center", size=32, backgroundcolor='white', alpha=0.4 )
    font0 = FontProperties()
    font0.set_family('sans-serif')
   
    plt.text(x, y, text, color='black', ha="center", va="center", size=64 , fontweight='bold', fontproperties=font0)
    if (plot_coords[2]=='Southern Indian Ocean'):
       plt.text(x, y, text, color='red', ha="center", va="center", size=64, fontproperties=font0)
开发者ID:peterwilletts24,项目名称:Python-Scripts,代码行数:14,代码来源:plot_from_pp_avg5216_regrid_diurnal_area_boxes.py

示例11: setLabels

# 需要导入模块: from matplotlib.font_manager import FontProperties [as 别名]
# 或者: from matplotlib.font_manager.FontProperties import set_family [as 别名]
 def setLabels(self):
     """ Set plot attributes """
     self.ppm.axpp.set_title("Seismograms")
     if self.opts.filemode == "pkl":
         axstk = self.axstk
         trans = transforms.blended_transform_factory(axstk.transAxes, axstk.transAxes)
         axstk.text(1, 1.01, self.opts.pklfile, transform=trans, va="bottom", ha="right", color="k")
     axpp = self.ppm.axpp
     trans = transforms.blended_transform_factory(axpp.transAxes, axpp.transData)
     font = FontProperties()
     font.set_family("monospace")
     axpp.text(1.025, 0, " " * 8 + "qual= CCC/SNR/COH", transform=trans, va="center", color="k", fontproperties=font)
开发者ID:xlougeo,项目名称:aimbat,代码行数:14,代码来源:qualctrl.py

示例12: make_legend

# 需要导入模块: from matplotlib.font_manager import FontProperties [as 别名]
# 或者: from matplotlib.font_manager.FontProperties import set_family [as 别名]
def make_legend(output_file, taxa_labels, colors):
    """ Hack to generate a separate legend image
        Creates a garbage pie chart (pretty, though)
        and saves its legend as a separate figure
    """ 
    fig = plt.figure()
    font_prop = FontProperties()
    font_prop.set_size('xx-large')
    font_prop.set_family('sans-serif')
    seperate_legend = plt.figure(figsize=(5,3.5))
    ax = fig.add_subplot(111)
    N = len(taxa_labels)
    wedges, texts = ax.pie([100/N]*N, colors=colors)   
    seperate_legend.legend(wedges, taxa_labels, 'center', prop=font_prop, frameon=False)
    seperate_legend.savefig(output_file)
开发者ID:samfway,项目名称:ag-plots,代码行数:17,代码来源:make_plots.py

示例13: watermark_seismic

# 需要导入模块: from matplotlib.font_manager import FontProperties [as 别名]
# 或者: from matplotlib.font_manager.FontProperties import set_family [as 别名]
def watermark_seismic(ax, text, size, colour, xn, yn=None):
    """
    Add semi-transparent text to the seismic.
    """
    font = FontProperties()
    font.set_weight('bold')
    font.set_family('sans-serif')
    style = {'size': size,
             'color': colour,
             'alpha': 0.5,
             'fontproperties': font
             }
    alignment = {'rotation': 33,
                 'horizontalalignment': 'left',
                 'verticalalignment': 'baseline'
                 }
    params = dict(style, **alignment)

    # Axis ranges.
    xr = ax.get_xticks()
    yr = ax.get_yticks()
    aspect = xr.size / yr.size
    yn = yn or (xn / aspect)
    yn += 1

    # Positions for even lines.
    xpos = np.linspace(xr[0], xr[-1], xn)[:-1]
    ypos = np.linspace(yr[0], yr[-1], yn)[:-1]

    # Intervals.
    xiv = xpos[1] - xpos[0]
    yiv = ypos[1] - ypos[0]

    # Adjust the y positions.
    ypos += yiv / 2

    # Place everything.
    c = False
    for y in ypos:
        for x in xpos:
            if c:
                xi = x + xiv / 2
            else:
                xi = x
            ax.text(xi, y, text, clip_box=ax.clipbox, clip_on=True, **params)
        c = not c

    return ax
开发者ID:svanschalkwyk,项目名称:seisplot,代码行数:50,代码来源:seisplot.py

示例14: labelStation

# 需要导入模块: from matplotlib.font_manager import FontProperties [as 别名]
# 或者: from matplotlib.font_manager.FontProperties import set_family [as 别名]
	def labelStation(self):
		"""
		Label stations at y axis on the right.
		The xcoords of the transform are axes, and the yscoords are data.
		"""
		axss = self.axss
		stations = [ sacdh.netsta for sacdh in self.saclist ]
		trans = transforms.blended_transform_factory(axss.transAxes, axss.transData)
		font = FontProperties()
		font.set_family('monospace')
		for i in range(self.nseis):
			axss.text(1.02, self.ybases[i], stations[i], transform=trans, va='center', 
				color=self.colors[i], fontproperties=font)
		if self.opts.stack_on:
			axss.text(1.02, self.stackbase, 'Stack', transform=trans, va='center',
				color=self.stackcolor, fontproperties=font)
开发者ID:ehparker,项目名称:pysmo,代码行数:18,代码来源:plotphase.py

示例15: temperature

# 需要导入模块: from matplotlib.font_manager import FontProperties [as 别名]
# 或者: from matplotlib.font_manager.FontProperties import set_family [as 别名]
def temperature():
    FONTSTYLE = "serif"
    FONTSIZE = 12
    hfont = {"family": FONTSTYLE, "fontsize": FONTSIZE}
    fontP = FontProperties()
    fontP.set_family(FONTSTYLE)
    fontP.set_size("small")

    gs = gridspec.GridSpec(1, 1)
    ax1 = plt.subplot(gs[0, :])

    winter = "/home/jana_jo/DLR/Codes/measurements/LMU/291116_LMU/"
    summer = "/home/jana_jo/DLR/Codes/measurements/Roof_DLR/2016_09_14RoofDLR/"
    import glob

    file_prefixes = ["darkcurrent"]
    files_winter = sorted([file_ for file_ in glob.iglob(winter + "%s*" % file_prefixes[0])])[5:7]
    files_summer = sorted([file_ for file_ in glob.iglob(summer + "%s*" % file_prefixes[0])])[3:5]
    files_winter = [files_winter[0]]
    for win in files_winter:
        print(win)
        win_dict = ip.parse_ibsen_file(win)
        ax1.plot(
            win_dict["wave"][50:], win_dict["mean"][50:], color="darkblue", label="-3 $^{\circ}$C" % win_dict["IntTime"]
        )

    files_summer = [files_summer[0]]
    for sum in files_summer:
        print(sum)
        sum_dict = ip.parse_ibsen_file(sum)
        ax1.plot(
            sum_dict["wave"][50:],
            sum_dict["mean"][50:],
            color="sandybrown",
            label="30 $^{\circ}$C" % sum_dict["IntTime"],
        )
    assert win_dict["IntTime"] == sum_dict["IntTime"]
    ax1.set_ylabel("DN [a.u.]", **hfont)
    ax1.set_ylabel("DN [a.u.]", **hfont)
    ax1.set_xlabel("Wavelength [nm]", **hfont)
    ax1.legend(loc="best", prop=fontP, title=r" %s ms Integrationtime at temperature:" % win_dict["IntTime"])
    plt.setp(ax1.get_legend().get_title(), fontsize="small", family=FONTSTYLE)
    plt.tight_layout()
    plt.show()
开发者ID:ZidCode,项目名称:ibsen_eval,代码行数:46,代码来源:tmp_nonlinear_check.py


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