• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python matplotlib.rc函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中matplotlib.rc函数的典型用法代码示例。如果您正苦于以下问题:Python rc函数的具体用法?Python rc怎么用?Python rc使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: plot_Q_by_year

def plot_Q_by_year(log=False,show=False,save=False,filename=''):
    mpl.rc('lines',markersize=6)
    fig, (Q2012,Q2013,Q2014,Q2015)=plt.subplots(4)
    letter_subplots(fig,0.1,0.95,'top','right','k',font_size=10,font_weight='bold')
    
    for ax in fig.axes:
        ax.plot_date(LBJ['Q'].index,LBJ['Q'],ls='-',marker='None',c='k',label='Q FG3')
        #ax.plot(LBJstageDischarge.index,LBJstageDischarge['Q-AV(L/sec)'],ls='None',marker='o',color='k')
        ax.set_ylim(0,LBJ['Q'].max()+500)  
    
    Q2014.axvline(study_start), Q2015.axvline(study_end)  
    Q2012.set_xlim(start2012,stop2012),Q2013.set_xlim(start2013,stop2013)
    Q2014.set_xlim(start2014,stop2014),Q2015.set_xlim(start2015,stop2015)
    Q2012.legend(loc='best')
    Q2013.set_ylabel('Discharge (Q) L/sec')
    #Q2012.set_title("Discharge (Q) L/sec at the Upstream and Downstream Sites, Faga'alu")
    
    for ax in fig.axes:
        ax.locator_params(nbins=6,axis='y')
        ax.xaxis.set_major_locator(mpl.dates.MonthLocator(interval=2))
        ax.xaxis.set_major_formatter(mpl.dates.DateFormatter('%b %Y'))
        
    plt.tight_layout(pad=0.1)
    logaxes(log,fig)
    show_plot(show,fig)
    savefig(save,filename)
    return
开发者ID:CaptainAL,项目名称:Fagaalu-Sediment-Flux,代码行数:27,代码来源:Load_Sediment_Data.py


示例2: test_rcparams

def test_rcparams():
    mpl.rc('text', usetex=False)
    mpl.rc('lines', linewidth=22)

    usetex = mpl.rcParams['text.usetex']
    linewidth = mpl.rcParams['lines.linewidth']
    fname = os.path.join(os.path.dirname(__file__), 'test_rcparams.rc')

    # test context given dictionary
    with mpl.rc_context(rc={'text.usetex': not usetex}):
        assert mpl.rcParams['text.usetex'] == (not usetex)
    assert mpl.rcParams['text.usetex'] == usetex

    # test context given filename (mpl.rc sets linewidth to 33)
    with mpl.rc_context(fname=fname):
        assert mpl.rcParams['lines.linewidth'] == 33
    assert mpl.rcParams['lines.linewidth'] == linewidth

    # test context given filename and dictionary
    with mpl.rc_context(fname=fname, rc={'lines.linewidth': 44}):
        assert mpl.rcParams['lines.linewidth'] == 44
    assert mpl.rcParams['lines.linewidth'] == linewidth

    # test rc_file
    mpl.rc_file(fname)
    assert mpl.rcParams['lines.linewidth'] == 33
开发者ID:jklymak,项目名称:matplotlib,代码行数:26,代码来源:test_rcparams.py


示例3: plot_monthly_average_consumption

def plot_monthly_average_consumption(mpc, country_list, ylabel='normalized', title='', kind='bar', linestyle='-', color='mbygcr', marker='o', linewidth=4.0, fontsize=16, legend=True):
    """
    This function plots the yearly data from a monthlypowerconsumptions object
    @param df: monthlypowerconsumptions object
    @param country_list: country names to add on the title of the plot
    @param ylabel: label for y axis
    @param title: graphic title
    @param kind: graphic type ex: bar or line
    @param linestyle: lines style
    @param color: color to use
    @param marker: shape of point on a line
    @param linewidth: line width
    @param fontsize: font size
    @return: n/a
    """

    # Plotting
    font = {'family' : 'normal',
            'weight' : 'bold',
            'size'   : 12}

    matplotlib.rc('font', **font)

    df = mpc.data_normalization(year=False)
    df = df.groupby('country').mean()
    del df['year']
    del df['Sum']
    df = df.T
    plot_several_countries(df[country_list], ylabel, title, kind=kind, linestyle=linestyle, color=color, marker=marker, linewidth=linewidth, fontsize=fontsize, legend=legend)
开发者ID:martatolos,项目名称:DemandAnalysis,代码行数:29,代码来源:visualizations.py


示例4: show_plate

    def show_plate():

        import matplotlib.pyplot as plt
        from matplotlib import rc
        import daft
        plt.rcParams['figure.figsize'] = 14, 8
        rc("font", family="serif", size=12)
        rc("text", usetex=False)

        pgm = daft.PGM(shape=[2.5, 3.5], origin=[0, 0], grid_unit=4,
                        label_params={'fontsize':18}, observed_style='shaded')

        pgm.add_node(daft.Node("lambda", r"$\lambda$", 1, 2.4, scale=2))
        pgm.add_node(daft.Node("alpha_0", r"$\alpha_0$", 0.8, 3, scale=2,
                                fixed=True, offset=(0,10)))
        pgm.add_node(daft.Node("lambda_0", r"$\lambda_0$", 1.2, 3, scale=2,
                                fixed=True, offset=(0,6)))
        pgm.add_node(daft.Node("y", r"$y_i$", 1, 1.4, scale=2, observed=True))
        pgm.add_plate(daft.Plate([0.5, 0.7, 1, 1.3], label=r"$i \in 1:N$", 
                                    shift=-0.1))

        pgm.add_edge("alpha_0", "lambda")
        pgm.add_edge("lambda_0", "lambda")
        pgm.add_edge("lambda", "y")

        pgm.render()
        plt.show()
开发者ID:JakeColtman,项目名称:SurPyval,代码行数:27,代码来源:exponential.py


示例5: __init__

    def __init__(self, parent, messenger=None,
                 size=(6.00,3.70), dpi=96, **kwds):

        self.is_macosx = False
        if os.name == 'posix':
            if os.uname()[0] == 'Darwin': self.is_macosx = True

        matplotlib.rc('axes', axisbelow=True)
        matplotlib.rc('lines', linewidth=2)
        matplotlib.rc('xtick',  labelsize=11, color='k')
        matplotlib.rc('ytick',  labelsize=11, color='k')
        matplotlib.rc('grid',  linewidth=0.5, linestyle='-')

        self.messenger = messenger
        if (messenger is None): self.messenger = self.__def_messenger

        self.conf = ImageConfig()
        self.cursor_mode='cursor'

        self.launch_dir  = os.getcwd()
        self.mouse_uptime= time.time()
        self.last_event_button = None

        self.view_lim  = (None,None,None,None)
        self.zoom_lims = [self.view_lim]
        self.old_zoomdc= (None,(0,0),(0,0))

        self.parent    = parent

        self._yfmt = '%.4f'
        self._xfmt = '%.4f'

        self.figsize = size
        self.dpi     = dpi
        self.__BuildPanel(**kwds)
开发者ID:damonwang,项目名称:dataviewer,代码行数:35,代码来源:IP.py


示例6: _test_determinism_save

def _test_determinism_save(filename, usetex):
    # This function is mostly copy&paste from "def test_visibility"
    # To require no GUI, we use Figure and FigureCanvasSVG
    # instead of plt.figure and fig.savefig
    from matplotlib.figure import Figure
    from matplotlib.backends.backend_svg import FigureCanvasSVG
    from matplotlib import rc
    rc('svg', hashsalt='asdf')
    rc('text', usetex=usetex)

    fig = Figure()
    ax = fig.add_subplot(111)

    x = np.linspace(0, 4 * np.pi, 50)
    y = np.sin(x)
    yerr = np.ones_like(y)

    a, b, c = ax.errorbar(x, y, yerr=yerr, fmt='ko')
    for artist in b:
        artist.set_visible(False)
    ax.set_title('A string $1+2+\\sigma$')
    ax.set_xlabel('A string $1+2+\\sigma$')
    ax.set_ylabel('A string $1+2+\\sigma$')

    FigureCanvasSVG(fig).print_svg(filename)
开发者ID:vapier,项目名称:matplotlib,代码行数:25,代码来源:test_backend_svg.py


示例7: plot_config

def plot_config(filetype='png'):
    import matplotlib
    # matplotlib.use('pdf')
    import matplotlib.pyplot
    params = {
        'text.usetex': True,
        'figure.dpi' : 300,
        'savefig.dpi' : 300,
        'savefig.format' : filetype,
        # 'axes.labelsize': 8, # fontsize for x and y labels (was 10)
        # 'axes.titlesize': 8,
        # 'text.fontsize': 8, # was 10
        # 'legend.fontsize': 8, # was 10
        # 'xtick.labelsize': 8,
        # 'ytick.labelsize': 8,
        # 'figure.figsize': [fig_width,fig_height],
        'font.family': 'serif',
        'text.latex.preamble': [r'\usepackage[]{siunitx}'
                                r'\usepackage[]{mhchem}'],
    }
    matplotlib.rcParams.update(params)
    matplotlib.style.use('bmh')
    matplotlib.style.use('seaborn-paper')
    # matplotlib.style.use('seaborn-dark-palette')

    matplotlib.rc('axes', facecolor='white')
    matplotlib.rc('grid', linestyle='-', alpha=0.0)
开发者ID:azonalon,项目名称:pyfiles,代码行数:27,代码来源:mpl.py


示例8: __get_plot_dict

 def __get_plot_dict(plot_style):
     """Define plot styles."""
     plot_dict = {
         Data.condor_running: ("Jobs running", "#b8c9ec"),  # light blue
         Data.condor_idle: ("Jobs available", "#fdbe81"),  # light orange
         Data.vm_requested: ("Slots requested", "#fb8a1c"),  # orange
         Data.vm_running: ("Slots available", "#2c7bb6"),  # blue
         Data.vm_draining: ("Slots draining", "#7f69db"),  # light blue
     }
     font = {"family": "sans", "size": 20}
     matplotlib.rc("font", **font)
     matplotlib.rcParams['pdf.fonttype'] = 42
     matplotlib.rcParams['ps.fonttype'] = 42
     if plot_style == "slide":
         matplotlib.rcParams["figure.figsize"] = 18, 8
         matplotlib.rcParams["svg.fonttype"] = "none"
         matplotlib.rcParams["path.simplify"] = True
         matplotlib.rcParams["path.simplify_threshold"] = 0.5
         matplotlib.rcParams["font.sans-serif"] = "Linux Biolinum O"
         matplotlib.rcParams["font.family"] = "sans-serif"
         matplotlib.rcParams["figure.dpi"] = 300
     elif plot_style == "screen":
         pass
     else:
         raise ValueError("Plotting style unknown!")
     return plot_dict
开发者ID:roced-scheduler,项目名称:ROCED,代码行数:26,代码来源:FreiburgPlotting.py


示例9: barplot

 def barplot(self, filename='', idx=None):
     """
     Plot a generic barplot using just the yVars.
     idx is the index of the each y-variable to be plotted. if not given, the last value will be used
     """
     import numpy
     mpl.rc('font',family='sans-serif')
     
     fig = plt.figure()
     ax = fig.add_subplot(111)
     
     position = numpy.arange(len(self.yVar),0,-1)
     # Reverse in order to go front top to bottom
     if not idx:
         idx = -1
     ax.barh(position, numpy.array([y.data[idx] for y in self.yVar]), align='center', alpha=0.5)
     plt.yticks(position, [y.label for y in self.yVar])
     
     # If any labels or titles are explicitly specified, write them
     if self.xlabel:
         plt.xlabel(self.xlabel)
         
     if self.ylabel:
         plt.ylabel(self.ylabel)
         
     if self.title:
         plt.title(self.title)
         
     plt.axis('tight')
     fig.savefig(filename, bbox_inches='tight')
开发者ID:PengZhang13,项目名称:RMG-Py,代码行数:30,代码来源:plot.py


示例10: plotAvgError

def plotAvgError(p1_win, p1_var,
                 p2_all_win, p2_all_var,
                 p2_day_win, p2_day_var, y_max=8):
    matplotlib.rc('font', size=18)
    width = 2
    index = np.arange(0, 7 * width * len(budget_cnts), width * 7)
    fig, ax = plt.subplots()
    rect1 = ax.bar(index, p1_win, width, color='b', hatch='/')
    rect2 = ax.bar(index + width, p1_var, width, color='r', hatch='\\')
    rect3 = ax.bar(index + width*2, p2_all_win, width, color='g', hatch='//')
    rect4 = ax.bar(index + width*3, p2_all_var, width, color='c', hatch='\\')
    rect5 = ax.bar(index + width*4, p2_day_win, width, color='m', hatch='x')
    rect6 = ax.bar(index + width*5, p2_day_var, width, color='y', hatch='//')
    ax.set_xlim([-3, 7 * width * (len(budget_cnts) + 0.1)])
    ax.set_ylim([0, y_max])
    ax.set_ylabel('Mean Absolute Error')
    ax.set_xlabel('Budget Count')
    ax.set_xticks(index + width * 2.5)
    ax.set_xticklabels(('0', '5', '10', '20', '25'))
    ax.legend((rect1[0], rect2[0], rect3[0], rect4[0], rect5[0], rect6[0]),
              ('Phase 1 Window', 'Phase 1 Variance',
               'Phase 2 H-Window', 'Phase 2 H-Variance',
               'Phase 2 D-Window', 'Phase 2 D-Variance'),
              ncol=2, fontsize=15)
    plt.grid()
    plt.savefig('%s_err.eps' % topic, format='eps',
                bbox_inches='tight')
开发者ID:littlepretty,项目名称:SensorPGM,代码行数:27,代码来源:run_phase2.py


示例11: show_cmaps

def show_cmaps(names=None):
    """display all colormaps included in the names list. If names is None, all
defined colormaps will be shown."""
    # base code from http://www.scipy.org/Cookbook/Matplotlib/Show_colormaps
    matplotlib.rc("text", usetex=False)
    a = np.outer(np.arange(0, 1, 0.01), np.ones(10))  # pseudo image data
    f = plt.figure(figsize=(10, 5))
    f.subplots_adjust(top=0.8, bottom=0.05, left=0.01, right=0.99)
    # get list of all colormap names
    # this only obtains names of built-in colormaps:
    maps = [m for m in cm.datad if not m.endswith("_r")]
    # use undocumented cmap_d dictionary instead
    maps = [m for m in cm.cmap_d if not m.endswith("_r")]
    maps.sort()
    # determine number of subplots to make
    l = len(maps) + 1
    if names is not None:
        l = len(names)  # assume all names are correct!
    # loop over maps and plot the selected ones
    i = 0
    for m in maps:
        if names is None or m in names:
            i += 1
            ax = plt.subplot(1, l, i)
            ax.axis("off")
            plt.imshow(a, aspect="auto", cmap=cm.get_cmap(m), origin="lower")
            plt.title(m, rotation=90, fontsize=10, verticalalignment="bottom")
    plt.savefig("colormaps.png", dpi=100, facecolor="gray")
开发者ID:jack-dob,项目名称:py_graphing,代码行数:28,代码来源:own_cmaps.py


示例12: update_graph

    def update_graph(self):
        self.plot.clear()
        self.picking_table = {}

        iattrs = set()
        dattrs = set()
        
        matplotlib.rc('font', **self.canvas_options.fontdict)

        # for now, plot everything on the same axis

        error_bars = self.canvas_options.show_error_bars

        for points, opts in self.pointsets:
            if not opts.is_graphed:
                continue
            points = self.canvas_options.modify_pointset(self,points)
            self.picking_table[points.label] = points
            opts.plot_with(self, points, self.plot, error_bars)

            iattrs.add(points.independent_var_name)
            dattrs.add(points.variable_name)

        if self.canvas_options.show_axes_labels:
            self.plot.set_xlabel(", ".join([i or "" for i in iattrs]), 
                                 fontdict=self.canvas_options.fontdict)
            self.plot.set_ylabel(", ".join([d or "" for d in dattrs]), 
                                 fontdict=self.canvas_options.fontdict)

        self.canvas_options.plot_with(self, self.plot)
        self.draw()
开发者ID:jrahm,项目名称:Calvin,代码行数:31,代码来源:plotting.py


示例13: __init__

    def __init__(self, parent, sz = None):
        self._canvas_options = options.PlotCanvasOptions()
        matplotlib.rc('font', **self.canvas_options.fontdict)
        
        super(PlotCanvas, self).__init__(parent, wx.ID_ANY, style=wx.RAISED_BORDER)
        if not sz:
            self.delegate = wxagg.FigureCanvasWxAgg(self, wx.ID_ANY, plt.Figure(facecolor=(0.9,0.9,0.9)))
        else:
            self.delegate = wxagg.FigureCanvasWxAgg(self, wx.ID_ANY, plt.Figure(facecolor=(0.9, 0.9, 0.9), figsize=sz))

        sizer = wx.BoxSizer(wx.HORIZONTAL)
        sizer.Add(self.delegate, 1, wx.EXPAND)

        self.plot = self.delegate.figure.add_axes([0.1,0.1,0.8,0.8])
        self.pointsets = []

        self.delegate.figure.canvas.mpl_connect('pick_event', self.on_pick)
        self.delegate.figure.canvas.mpl_connect('motion_notify_event', self.on_motion)
        # self.figure.canvas.mpl_connect('motion_notify_event',self.on_motion)
        self.annotations = {}
        # used to index into when there is a pick event
        self.picking_table = {}
        self.dist_point = None

        self.SetSizerAndFit(sizer)
开发者ID:jrahm,项目名称:Calvin,代码行数:25,代码来源:plotting.py


示例14: plotBottleneck

def plotBottleneck(maxGen=None,obs=False,mean=True,color='blue'):
    exit()

    def plotOne(df, ax, method):
        m=df.mean(1)
        s=df.std(1)
        # plt.locator_params(nbins=4);
        m.plot(ax=ax, legend=False, linewidth=3, color=color)
        x=m.index.values
        m=m.values;s=s.values
        ax.fill_between(x, m - 2 * s, m + 2 * s, color=color, alpha=0.3)
        ax.set_ylabel(method.strip())
        ax.set_ylim([-0.1, ax.get_ylim()[1]])

        pplt.setSize(ax)

    dfn = \
        pd.read_pickle(path + 'nu{}.s{}.df'.format(0.005, 0.0))
    fig, ax = plt.subplots(3, 1, sharex=True, figsize=(4, 3), dpi=300)
    plotOne(dfn['tajimaD'], ax[0], "Tajima's $D$");
    plt.xlabel('Generations')
    plotOne(dfn['HAF'], ax[1], "Fay Wu's $H$");
    plt.xlabel('Generations')
    plotOne(dfn['SFSelect'], ax[2], 'SFSelect');
    plt.xlabel('Generations')
    plt.gcf().subplots_adjust(bottom=0.25)
    mpl.rc('font', **{'family': 'serif', 'serif': ['Computer Modern']});
    mpl.rc('text', usetex=True)
    pplt.savefig('bottleneck', 300)
    plt.show()
开发者ID:airanmehr,项目名称:bio,代码行数:30,代码来源:Dynamics.py


示例15: subplot_modes

def subplot_modes(modes):
    """
    modes is a list of lists (one for each natural frequency)
    each sublist contains 3-comp tuples with (label, freq, mode)
    """
    n = len(modes)
    print "\nPloting {0} first modes:".format(n)

    # initiate plot
    fig, axarr = plt.subplots(n, sharex=True)

    rc('font', **{'family': 'sans-serif',
                  'sans-serif': ['Computer Modern Roman']})
    # rc('text', usetex=True)
    legend_kwargs = {'loc': 'center left', 'bbox_to_anchor': (1, 0.5)}
    for i, mode_container in enumerate(modes):
        print "\nMode {0}".format(i+1)

        legend = map(lambda x: " ".join((x[0], "(f={0:.2f} Hz)".format(x[1]))),
                     mode_container)
        modes_i = map(lambda x: x[2], mode_container)

        for j, mode in enumerate(modes_i):
            x = np.linspace(0, L, len(mode))
            axarr[i].plot(x, mode, style_gen(j, j))
        axarr[i].legend(legend, **legend_kwargs)
        axarr[i].grid()

    axarr[n-1].set_xlabel(r"Length of the beam ($y$ axis) in meters")
    axarr[n/2].set_ylabel(r"Normalized deflection")
    plt.subplots_adjust(right=0.6)
开发者ID:ionelberdin,项目名称:fem1Dbeam,代码行数:31,代码来源:hermes_beam.py


示例16: config_mpl

def config_mpl():
    mpl.rc('lines', linewidth=1.5)
    mpl.rc('font', family='Times New Roman', size=16, monospace='Courier New')
    mpl.rc('legend', fontsize='small', fancybox=False,
           labelspacing=0.1, borderpad=0.1, borderaxespad=0.2)
    mpl.rc('figure', figsize=(12, 10))
    mpl.rc('savefig', dpi=120)
开发者ID:amandajshao,项目名称:Slicing-CNN,代码行数:7,代码来源:show_log.py


示例17: create_figures

def create_figures(data):
    import numpy as np
    print "# Creating figure ..."
    # prepare matplotlib
    import matplotlib
    matplotlib.rc("font",**{"family":"sans-serif"})
    matplotlib.rcParams.update({'font.size': 14})
    matplotlib.rc("text", usetex=True)
    matplotlib.use("PDF")
    import matplotlib.pyplot as plt

    # KSP
    plt.figure(1)
    n, bins, patches = plt.hist(data[:, 1], bins = 50, fc = "k", ec = "w")
    plt.xticks(range(300, 1001, 100), range(300, 1001, 100))
    plt.yticks(range(0, 17, 2), range(0, 17, 2))
    plt.xlabel("Model years")
    plt.ylabel("Occurrence")
    plt.savefig("parameterrange-ksp", bbox_inches = "tight")

    # SNES
    plt.figure(2)
    n, bins, patches = plt.hist(data[:, 0], bins = 50, fc = "k", ec = "w")
    plt.xticks(range(5, 46, 5), range(5, 46, 5))
    plt.yticks(range(0, 15, 2), range(0, 15, 2))
    plt.xlabel("Newton steps")
    plt.ylabel("Occurrence")
    plt.savefig("parameterrange-snes", bbox_inches = "tight")
开发者ID:metos3d,项目名称:2016-GMD-Metos3D,代码行数:28,代码来源:create-figure.py


示例18: plotLDDecaySelection3d

def plotLDDecaySelection3d(ax, sweep=False):
    import pylab as plt; import matplotlib as mpl;mpl.rc('font', **{'family': 'serif', 'serif': ['Computer Modern'], 'size':16}) ;    mpl.rc('text', usetex=True)

    def neutral(ld0, t, d, r=2 * 1e-8):
        if abs(d) <= 5e3:
            d = np.sign(d) * 5e3
        if d == 0:
            d = 5e3
        return ((np.exp(-2 * r * t * abs(d)))) * ld0

    t = np.arange(0, 200 + 1., 2)
    L=1e6+1
    pos=500000
    r=2*1e-8
    ld0 = 0.5
    s = 0.05
    nu0 = 0.1
    positions=np.arange(0,L,1000)
    dist=(positions - pos)
    T, D = np.meshgrid(t, dist)
    if not sweep:
        zs = np.array([neutral(ld0, t, d) for t, d in zip(np.ravel(T), np.ravel(D))])
    else:
        zs = np.array([LD(t, ld0, s, nu0, r, abs(d), 0) for t, d in zip(np.ravel(T), np.ravel(D))])
    Z = zs.reshape(T.shape)
    ax.plot_surface(T, D, Z,cmap=mpl.cm.autumn)
    ax.set_xlabel('Generations')
    ax.set_ylabel('Position')
    plt.yticks(plt.yticks()[0][1:-1],map(lambda x:'{:.0f}K'.format((pos+(x))/1000),plt.yticks()[0][1:-1]))
    plt.ylim([-500000,500000])
    ax.set_zlabel(r"$|\rho_t|$")
    pplt.setSize(plt.gca(), fontsize=6)
    plt.axis('tight');
开发者ID:airanmehr,项目名称:bio,代码行数:33,代码来源:LD.py


示例19: plot_bias

def plot_bias(bias_list, fpath):
    import matplotlib as mpl
    import matplotlib.pyplot as plt
    import seaborn as sns

    sys.stderr.write("saving to %s\n" % fpath)
    p = sns.color_palette("deep", desat=.8)
    c1, c2 = p[0], p[-1]
    c1, c2 = sns.color_palette("Set1", 2)

    mpl.rc("figure", figsize=(8, 4))
    f, ax1 = plt.subplots(1)

    xs = [int(x['base']) for x in bias_list]

    ax1.plot(xs, [100 * float(x['read_1']) for x in bias_list], c=c1,
             label="read 1")
    ax1.plot(xs, [100 * float(x['read_2']) for x in bias_list], c=c2,
             label="read 2")
    ax1.axvline(x=4, c="#aaaaaa", alpha=0.8, linewidth=3, zorder=-1)
    ax1.axvline(x=max(xs) - 4, c="#aaaaaa", alpha=0.8, linewidth=3, zorder=-1)

    ax1.legend(loc='upper center')
    ax1.set_xlim(min(xs), max(xs))
    ax1.set_ylabel('mean CG % methylation')
    ax1.set_xlabel('position along read')
    ax1.set_title('Methylation Bias Plot (vertical lines at 4 bases from end)')
    ax1.grid('off')

    f.tight_layout()
    f.savefig(fpath)
开发者ID:arcolombo,项目名称:bwa-meth,代码行数:31,代码来源:bias-plot.py


示例20: plot_runtime_results

def plot_runtime_results(results):
    plt.rcParams["figure.figsize"] = 7,7
    plt.rcParams["font.size"] = 22
    matplotlib.rc("xtick", labelsize=24)
    matplotlib.rc("ytick", labelsize=24)

    params = {"text.fontsize" : 32,
              "font.size" : 32,
              "legend.fontsize" : 30,
              "axes.labelsize" : 32,
              "text.usetex" : False
              }
    plt.rcParams.update(params)
    
    #plt.semilogx(results[:,0], results[:,3], 'r-x', lw=3)
    #plt.semilogx(results[:,0], results[:,1], 'g-D', lw=3)
    #plt.semilogx(results[:,0], results[:,2], 'b-s', lw=3)

    plt.plot(results[:,0], results[:,3], 'r-x', lw=3, ms=10)
    plt.plot(results[:,0], results[:,1], 'g-D', lw=3, ms=10)
    plt.plot(results[:,0], results[:,2], 'b-s', lw=3, ms=10)

    plt.legend(["Chain", "Tree", "FFT Tree"], loc="upper left")
    plt.xticks([1e5, 2e5, 3e5])
    plt.yticks([0, 60, 120, 180])

    plt.xlabel("Problem Size")
    plt.ylabel("Runtime (sec)")
    return results
开发者ID:kswersky,项目名称:CaRBM,代码行数:29,代码来源:sum_cardinality.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python matplotlib.rc_context函数代码示例发布时间:2022-05-27
下一篇:
Python matplotlib.plot函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap