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

Python pyplot.rgrids函数代码示例

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

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



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

示例1: plot_radar

def plot_radar(example_data,nVar):
    N = nVar
    theta = radar_factory(N, frame='polygon')

    data = example_data
    people_Num=len(data)
    spoke_labels = data.pop('column names')

    fig = plt.figure(figsize=(9, 2*people_Num))
    fig.subplots_adjust(wspace=0.55, hspace=0.10, top=0.95, bottom=0.05)

    colors = ['b', 'r', 'g', 'm', 'y']
    for n, title in enumerate(data.keys()):
        ax = fig.add_subplot(int(people_Num/3)+1, 3, n+1, projection='radar')
        plt.rgrids([0.2, 0.4, 0.6, 0.8])
        plt.setp(ax.get_yticklabels(), visible=False)
        plt.ylim([0,1]) 
        ax.set_title(title, weight='bold', size='medium', position=(0.5, 1.1),color='b',
                     horizontalalignment='center', verticalalignment='center',fontproperties=zhfont)
        for d, color in zip(data[title], colors):
            ax.plot(theta, d, color=color)
            ax.fill(theta, d, facecolor=color, alpha=0.25)
        ax.set_varlabels(spoke_labels)

    plt.subplot(int(people_Num/3)+1, 3, 1)

    plt.figtext(0.5, 0.965, '战力统计',fontproperties=zhfont,
                ha='center', color='black', weight='bold', size='large')
    plt.show()
开发者ID:yangyangjuanjuan,项目名称:wechatAnalyzer,代码行数:29,代码来源:radar_plot.py


示例2: plot

    def plot(self, legend=True, fig_title=None):
        theta = radar_factory(self.get_data_size(), frame="polygon")

        fig = plt.figure(figsize=(9, 9))
        fig.subplots_adjust(wspace=0.25, hspace=0.20, top=0.85, bottom=0.05)

        colors = ["b", "r", "g", "m", "y"]
        # Plot the four cases from the example data on separate axes
        for n, title in enumerate(self._data.keys()):
            ax = fig.add_subplot(2, 2, n + 1, projection="radar")
            plt.rgrids([0.02, 0.04, 0.06, 0.08])
            ax.set_title(
                title,
                weight="bold",
                size="medium",
                position=(0.5, 1.1),
                horizontalalignment="center",
                verticalalignment="center",
            )
            for d, color in zip(self._data[title], colors):
                ax.plot(theta, d, color=color)
                ax.fill(theta, d, facecolor=color, alpha=0.25)
            ax.set_varlabels(self._labels)

        if legend:
            self.plot_legend()
        if fig_title is not None:
            self.plot_title(fig_title)
        plt.show()
开发者ID:ulyssek,项目名称:neuroscience,代码行数:29,代码来源:radar_chart.py


示例3: radar_plot

def radar_plot():
    """
    radar plot
    """
    # 生成测试数据
    labels = np.array(["A组", "B组", "C组", "D组", "E组", "F组"])
    data = np.array([68, 83, 90, 77, 89, 73])
    theta = np.linspace(0, 2*np.pi, len(data), endpoint=False)

    # 数据预处理
    data = np.concatenate((data, [data[0]]))
    theta = np.concatenate((theta, [theta[0]]))

    # 画图方式
    plt.subplot(111, polar=True)
    plt.title("雷达图", fontproperties=myfont)

    # 设置"theta grid"/"radar grid"
    plt.thetagrids(theta*(180/np.pi), labels=labels, fontproperties=myfont)
    plt.rgrids(np.arange(20, 100, 20), labels=np.arange(20, 100, 20), angle=0)
    plt.ylim(0, 100)

    # 画雷达图,并填充雷达图内部区域
    plt.plot(theta, data, "bo-", linewidth=2)
    plt.fill(theta, data, color="red", alpha=0.25)

    # 图形显示
    plt.show()
    return
开发者ID:hepeng1008,项目名称:LearnPython,代码行数:29,代码来源:python_visual.py


示例4: plot_graph

def plot_graph(var_stats, var_clean, var_evil):

    try:
        import matplotlib.pyplot as plt       
    except:
        sys.sderr.write("matploitlib not found")
        sys.exit(1)

    N = 4 # az AZ 09 other
    theta = radar_factory(N, frame='circle')
    spoke_labels = ["[a-z]", "[A-Z]", "[0-9]", "[other]"]

    fig = plt.figure(figsize=(15, 8))
    fig.subplots_adjust(wspace=0.20, hspace=0.20, top=1.00, bottom=0.00, left=0.05, right=0.93)

    """
    # Overall
    ax = fig.add_subplot(2, 2, 3, projection='radar')
    plt.rgrids([20, 40, 60, 80])

    ax.set_title("Overall", weight='bold', size='medium', position=(0.5, 1.1), horizontalalignment='center', verticalalignment='center')

    for varname, varfeatures in var_stats.iteritems():
        d = [ varfeatures['az'], varfeatures['AZ'], varfeatures['09'], varfeatures['other'] ]
        color = 'green' if varname in var_clean else 'red'
        ax.plot(theta, d, color=color)
        ax.fill(theta, d, facecolor=color, alpha=0.25)
    ax.set_varlabels(spoke_labels)
    """

    # Clean
    ax = fig.add_subplot(1, 2, 1, projection='radar')
    plt.rgrids([20, 40, 60, 80])

    ax.set_title("Clean", weight='bold', size='medium', position=(0.5, 1.1), horizontalalignment='center', verticalalignment='center')

    for varname, varfeatures in var_clean.iteritems():
        d = [ varfeatures['az'], varfeatures['AZ'], varfeatures['09'], varfeatures['other'] ]
        ax.plot(theta, d, color='green')
        ax.fill(theta, d, facecolor='green', alpha=0.25)
    ax.set_varlabels(spoke_labels)

    # Evil
    ax = fig.add_subplot(1, 2, 2, projection='radar')
    plt.rgrids([20, 40, 60, 80])

    ax.set_title("Evil", weight='bold', size='medium', position=(0.5, 1.1), horizontalalignment='center', verticalalignment='center')

    for varname, varfeatures in var_evil.iteritems():
        d = [ varfeatures['az'], varfeatures['AZ'], varfeatures['09'], varfeatures['other'] ]
        ax.plot(theta, d, color='red')
        ax.fill(theta, d, facecolor='red', alpha=0.25)
    ax.set_varlabels(spoke_labels)

    plt.figtext(0.5, 0.965, 'Variable/Function name features distribution',
                ha='center', color='black', weight='bold', size='large')
    plt.figtext(0.5, 0.935, 'PRICK v0.1',
                ha='center', color='black', weight='normal', size='medium')

    plt.show()
开发者ID:jseidl,项目名称:prick,代码行数:60,代码来源:prick.py


示例5: create_plot

def create_plot():
    N = 9
    theta = radar_factory(N, frame='circle')

    data = example_data()
    spoke_labels = data.pop(0)

    fig = plt.figure(figsize=(9, 9))
    fig.subplots_adjust(wspace=0.25, hspace=0.20, top=0.85, bottom=0.05)

    colors = ['b', 'r', 'g', 'm', 'y']
    # Plot the four cases from the example data on separate axes
    for n, (title, case_data) in enumerate(data):
        ax = fig.add_subplot(2, 2, n + 1, projection='radar')
        plt.rgrids([0.2, 0.4, 0.6, 0.8])
        ax.set_title(title, weight='bold', size='medium', position=(0.5, 1.1),
                     horizontalalignment='center', verticalalignment='center')
        for d, color in zip(case_data, colors):
            ax.plot(theta, d, color=color)
            ax.fill(theta, d, facecolor=color, alpha=0.25)
        ax.set_varlabels(spoke_labels)

    # add legend relative to top-left plot
    plt.subplot(2, 2, 1)
    labels = ('Factor 1', 'Factor 2', 'Factor 3', 'Factor 4', 'Factor 5')
    legend = plt.legend(labels, loc=(0.9, .95), labelspacing=0.1)
    plt.setp(legend.get_texts(), fontsize='small')

    plt.figtext(0.5, 0.965, '5-Factor Solution Profiles Across Four Scenarios',
                ha='center', color='black', weight='bold', size='large')
    plt.show()
开发者ID:rahlk,项目名称:Bellwether,代码行数:31,代码来源:spider.py


示例6: subplot

def subplot(data, spoke_labels, sensor_labels,saveto=None,frame_type='polygon'):
    #def subplot(data, spoke_labels, sensor_labels,saveto=None,frame_type='polygon'):
    num_of_picks=9
    theta = radar_factory(len(spoke_labels), frame='circle')
    fig = plt.figure(figsize=(num_of_picks, num_of_picks))
    fig.subplots_adjust(wspace=0.25, hspace=0.20, top=0.85, bottom=0.05)
    num_col=np.floor(np.sqrt(len(data)))
    num_row=np.ceil(num_of_picks/num_col)
    for k,(data_col,sensor_label_) in enumerate(zip(data,sensor_labels)):
        #subplot(num_col,num_row,i+1)
        ax = fig.add_subplot(num_col,num_row,k+1, projection="radar")
        ax.plot(theta, data_col)
        ax.fill(theta, data_col, alpha=0.2)
        ax.set_varlabels(spoke_labels)
        #plt.title(sensor_label_,fontsize='small')
        legend = plt.legend([sensor_label_], loc=(-0.2, 1.1), labelspacing=0.01)
        plt.setp(legend.get_texts(), fontsize='small')
        radar_bnd=max(max(data))
        #import pdb;pdb.set_trace()
        rgrid_spacing=np.round(list(np.arange(0.1,radar_bnd,float(radar_bnd)/5)),2)
        plt.rgrids(rgrid_spacing)
        #plt.rgrids([0.1 + 2*i / 10.0 for i in range(radar_bnd)])
        ##radar_chart.plot(data_col, spoke_labels, sensor_label_, saveto="time_radar.png",frame_type='circle')    
    if saveto != None:
        plt.savefig(saveto)        
开发者ID:TinyOS-Camp,项目名称:DDEA-DEV,代码行数:25,代码来源:radar_chart.py


示例7: plot_radar

def plot_radar(data, titles, title='', legends=None, normalize=False, colors=None, fill=True):
    r = data.copy()
    if normalize:
        r.loc[:, titles] = MaxAbsScaler().fit_transform(r.loc[:, titles])
    case_data = r
    case_data.reset_index(inplace=True)
    theta = radar_factory(len(titles), frame='polygon')

    fig = plt.figure(figsize=(7, 7))
    fig.subplots_adjust(wspace=0.25, hspace=0.20, top=0.85, bottom=0.05)

    if colors is None:
        colors = "bgrcmykw"

    ax = fig.add_subplot(1, 1, 1, projection='radar')
    plt.rgrids([0.2, 0.4, 0.6, 0.8])
    ax.set_title(title, weight='bold', size='medium', position=(0.5, 1.1),
                 horizontalalignment='center', verticalalignment='center')
    for d, color in zip(case_data[titles].values, colors):
        ax.plot(theta, d, color=color)
        if fill:
            ax.fill(theta, d, facecolor=color, alpha=0.25)
    # ax.set_rmax(1.0)
    ax.set_varlabels(titles)

    # add legend relative to top-left plot
    if legends:
        plt.subplot(1, 1, 1)
        labels = legends
        legend = plt.legend(labels, loc=(0.9, .95), labelspacing=0.2)
        plt.setp(legend.get_texts(), fontsize=15)
        plt.setp(legend.get_lines(), linewidth=13, alpha=0.50)

    plt.show()
开发者ID:Andreslos,项目名称:talks,代码行数:34,代码来源:radar.py


示例8: sonar_graph

def sonar_graph(ping_readings):
	#print "ping reading:", ping_readings
	#print type(ping_readings[1])
	# force square figure and square axes looks better for polar, IMO
	fig = figure(figsize=(3.8,3.8))
	ax = P.subplot(1, 1, 1, projection='polar')
	P.rgrids([28, 61, 91])
	ax.set_theta_zero_location('N')
	ax.set_theta_direction(-1)

	try:
		theta = 346
		angle = theta * np.pi / 180.0
		radii = [ping_readings[0]]
		width = .15
		bars1 = ax.bar(0, 100, width=0.001, bottom=0.0)
		#print "theta, radii, width: ", theta, radii, width
		bars = ax.bar(angle, radii, width=width, bottom=0.0, color='blue')
		theta = 6
		angle = theta * np.pi / 180.0
		radii = [ping_readings[1]]
		width = .15
		bars = ax.bar(angle, radii, width=width, bottom=0.0, color='blue')	
		theta = 86
		angle = theta * np.pi / 180.0
		radii = [ping_readings[2]]
		width = .15
		bars = ax.bar(angle, radii, width=width, bottom=0.0, color='blue')
		theta = 266
		angle = theta * np.pi / 180.0
		radii = [ping_readings[3]]
		width = .15
		bars = ax.bar(angle, radii, width=width, bottom=0.0, color='blue')
		img_to_return = fig2img(fig)
		P.close(fig)
		return img_to_return 
	except:
		print "Sonar data error... can't graph"
		pass
	#print "finshed graph"
	#pil_img = fig2img(fig)
	#sonar_image = pil_img
	#print type(pil_img), pil_img
	#sonar_image = PILtoCV_4Channel(pil_img)
	#cv.ShowImage("Sonar", sonar_image )
	#cv.MoveWindow ('Sonar',50 ,50 )
	#time.sleep(.01)
	#cv.WaitKey(10)
	#enable line below to make basestation work 12/13/2012
	#fig.savefig('sonar_image.png')

	#Image.open('sonar_image.png').save('sonar_image.jpg','JPEG')
	#print "finished saving"
	#stop
	#garbage cleanup
	#fig.clf()
	
	#gc.collect()
	#del fig
	P.close(fig)
开发者ID:Tfou57,项目名称:robomow,代码行数:60,代码来源:sonar_functions.py


示例9: buildRadar

def buildRadar(data, name):
    N = 7
    theta = radar_factory(N, frame="polygon")
    spoke_labels = data.pop(0)

    fig = plt.figure(figsize=(7, 7))
    fig.subplots_adjust(wspace=0.25, hspace=0.20, top=0.85, bottom=0.05)

    colors = ["b", "r", "g", "m", "y"]
    # Plot the four cases from the example data on separate axes
    for n, (title, case_data) in enumerate(data):
        ax = fig.add_subplot(2, 2, n + 1, projection="radar")
        plt.rgrids([0.2, 0.4, 0.6, 0.8])
        ax.set_title(
            title,
            weight="bold",
            size="medium",
            position=(0.5, 1.1),
            horizontalalignment="center",
            verticalalignment="center",
        )
        for d, color in zip(case_data, colors):
            ax.plot(theta, d, color=color)
            ax.fill(theta, d, facecolor=color, alpha=0.25)
        ax.set_varlabels(spoke_labels)

    # add legend relative to top-left plot
    plt.subplot(2, 2, 1)
    labels = ("Factor 1", "Factor 2", "Factor 3", "Factor 4", "Factor 5")
    plt.figtext(0.5, 0.965, "TITLE", ha="center", color="black", weight="bold", size="large")
    savefig(name)
    plt.clf()
开发者ID:nplevitt,项目名称:SentimentCap,代码行数:32,代码来源:radar.py


示例10: overlaid_plot

def overlaid_plot(terms, ICA_component_number, savepath=None, filtered_num=False):
    """
    Args:
        - ICA_component_number: integer that corresponds to ICA analysis and directory
        - savepath: just shows if no path is provided
        - filtered_num: Integer that corresponds to the number of terms desired in 
                    the radar plot.
    """
    ICA_path = '/Volumes/Huettel/KBE.01/Analysis/Neurosynth/ICA/ICA%s' %ICA_component_number

    big_list = get_all_term_weights(terms, ICA_path)

    if filtered_num:
        big_list = term_weight_filter(big_list, filtered_num)
        N = filtered_num
    else:
        N = ICA_component_number

    data = convert_final_data(big_list)
    
    theta = radar_factory(N, frame='polygon')

    spoke_labels = data.pop('column names')

    fig = plt.figure(figsize=(9, 9))
    fig.subplots_adjust(wspace=0.25, hspace=0.20, top=0.85, bottom=0.05)

    colors = ['b', 'r', 'g', 'y', 'm']
    # Plot the four cases from the example data on separate axes
    for n, title in enumerate(data.keys()):
        ax = fig.add_subplot(1, 1, n+1, projection='radar')
        plt.rgrids([2, 4, 6, 8])
        #plt.rgrids([0.2, 0.4, 0.6, 0.8])
        ax.set_title(title, weight='bold', size='medium', position=(0.5, 1.1),
                     horizontalalignment='center', verticalalignment='center')
        for d, color in zip(data[title], colors):
            ax.set_ylim(0,10)
            ax.plot(theta, d, color=color)
            ax.fill(theta, d, facecolor=color, alpha=0.25)
        ax.set_varlabels(spoke_labels)

    # add legend relative to top-left plot
    plt.subplot(1, 1, 1)
    labels = tuple(terms)
    legend = plt.legend(labels, loc=(0.9, .95), labelspacing=0.1)
    plt.setp(legend.get_texts(), fontsize='large')
    plt.figtext(0.5, 0.965, '',
                ha='center', color='black', weight='bold', size='large')

    if savepath == None:
        plt.show()
    else:
        plt.savefig(savepath)
开发者ID:law826,项目名称:Neurosynth_SNA,代码行数:53,代码来源:radar_plot.py


示例11: initialisation_graphe

def initialisation_graphe(ondes,enonce=True):
    plt.clf()            # Nettoyage, on commence un nouveau graphe
    plt.axes(polar=True) # On initie un graphe en polaires
    # Puis on définit le titre
    if enonce: titre = 'Enonce: Sommer '
    else     : titre = 'Corrige: Sommer '
    titre += ", ".join(['${}$'.format(o) for o in ondes[:-1]])
    titre += " et ${}$.".format(ondes[-1])
    plt.title(titre)
    # et finalement les grilles en distances
    plt.rgrids([i+1 for i in range(max_size)])
    plt.thetagrids([i*15 for i in range(360//15)]) # et en angles
开发者ID:FabricePiron,项目名称:py4phys,代码行数:12,代码来源:S03_fresnel.py


示例12: draw_radar

def draw_radar(weapons, color_cluster, fitness_cluster, num_samples):

    N = 10
    theta = radar_factory(N, frame='polygon')

    data = get_data(weapons)
    spoke_labels = data.pop('column names')

    fig = plt.figure(figsize=(16, 9))
    fig.subplots_adjust(wspace=0.50, hspace=0.25)

    colors = ['b', 'r', 'g', 'm', 'y']

    weapons = data['Weapon1'], data['Weapon2']

    for i in range(len(weapons)) :
        ax = fig.add_subplot(2, 3, i+1, projection='radar')
        plt.rgrids([0.5], (''))
        ax.set_title("Weapon" + str(i+1), weight='bold', size='medium', position=(0.5, 1.1),
                     horizontalalignment='center', verticalalignment='center')
        ax.plot(theta, weapons[i], color=color_cluster)
        ax.fill(theta, weapons[i], facecolor=color_cluster, alpha=0.25)
        ax.set_varlabels(spoke_labels)

    ax = fig.add_subplot(2, 3, 4)

    plt.ylim(0, 3)
    ax.set_title("Balance")
    ax.boxplot( [fitness_cluster[i][0] for i in range(len(fitness_cluster))] )

    ax = fig.add_subplot(2, 3, 5)

    plt.ylim(0, 2500)
    ax.set_title("Distance")
    ax.boxplot( [fitness_cluster[i][1] for i in range(len(fitness_cluster))] )

    ax = fig.add_subplot(2, 3, 6)

    plt.ylim(0, 20)
    ax.set_title("Kill Streak")
    ax.boxplot( [fitness_cluster[i][2] for i in range(len(fitness_cluster))] )

    # add legend relative to top-left plot
    '''
    plt.subplot(2, 2, 1)
    labels = ('Factor 1', 'Factor 2', 'Factor 3', 'Factor 4', 'Factor 5')
    legend = plt.legend(labels, loc=(0.9, .95), labelspacing=0.1)
    plt.setp(legend.get_texts(), fontsize='small')
    '''

    plt.figtext(0.5, 0.965, 'Mean of clustered weapon, samples = ' + str(num_samples),
                ha='center', color='black', weight='bold', size='large')
开发者ID:DanieleGravina,项目名称:ProceduralWeapon,代码行数:52,代码来源:radar_chart_multi.py


示例13: create_figure

def create_figure(all_data): # takes in data and title and creates and saves plot

    width = 0.45  # width of the bars (in radians)

    # create the figure, dont change
    fig = plt.figure()
    ax = fig.add_subplot(111, polar=True)

    # angle positions, 0 to 360 with increments of 360/5
    xo = list(range(0, 360, 360 / 5))
    # Convert to radians and subtract half the width
    # of a bar to center it.
    x = [i * pi / 180 for i in xo]

    # set the labels for each bar, do not change
    ax.set_xticks(x)
    ax.set_xticklabels(['Military\nProwess', 'Productivity', 'Resource', 'Self-\nSufficiency', 'Morale'])
    ax.set_thetagrids(xo, frac=1.15) # frac changes distance of label from circumference of circle

    plt.ylim(0, 100) # sets range for radial grid

    fig.suptitle("India \n1993-2012", fontsize=20, y=0.5, x=0.1) # title of plot

    plt.rgrids([20, 40, 60, 80, 100], angle=33, fontsize=10) # the numbers you see along radius, angle changes position

    colorList = [];

    count = -1
    for key in all_data:
        count = count + 1
        data = all_data[key]
        mylist = [item+0.5*(count-len(all_data)/2)/len(all_data) for item in x]
        bars = ax.bar(mylist, data, width=width, align='center') # do the plotting
        i = 0
        for r, bar in zip(data, bars):
            bar.set_facecolor( cm.jet(0.8*count/len(all_data))) # set color for each bar, intensity proportional to height of bar
            colorList.append(cm.jet(0.8*count/len(all_data)))
            #bar.set_alpha(0.2) # make color partly transparent
            
            height = bar.get_height() # this is basically the radial height, or radius of bar

            # write value of each bar inside it
            # first param is angle, second is radius -10 makes it go inside the bar
        
            if i == 3 and count == 0:
                ax.text(mylist[i]-width/4*3, height+5, key, ha='center', va='center', fontsize=11)
            if i == 3 and count == len(all_data)-1:
                ax.text(mylist[i]+width/4*3, height-5, key, ha='center', va='center', fontsize=11)
            i = i + 1

    
    plt.savefig('examples/multiple.png')
开发者ID:aadra,项目名称:Global_power_index,代码行数:52,代码来源:multiple_vis.py


示例14: main

def main():
    azi = wd_11_12
    z = ws_11_12

    plt.figure(figsize=(5,6))
    plt.subplot(111, projection='polar')
    coll = rose(azi, z=z, bidirectional=True)
    plt.xticks(np.radians(range(0, 360, 45)), 
               ['N', 'NE', 'E', 'SE', 'S', 'SW', 'W', 'NW'])
    plt.colorbar(coll, orientation='horizontal')
    plt.xlabel('2011 - 2012 3m Wind rose colored by mean wind speed')
    plt.rgrids(range(5, 20, 5), angle=290)

    plt.savefig('/home/cparr/Snow_Patterns/figures/wind/winter_11_12.png',dpi = 300)

    plt.show()
开发者ID:charparr,项目名称:tundra-snow,代码行数:16,代码来源:polar.py


示例15: plot_phaseplot_l

def plot_phaseplot_l(dictdata, keys, autok, title, withn='yes'):
    """Plots a phase plot where the radius is not fixed to 1."""
    
    colors = ['r', 'b', 'g', 'y', 'k']
    
    plt.suptitle(title, fontsize='large' )
    if autok == 'yes':
        k = dictdata.keys()
    
    for i, condition in enumerate(keys):
        datac = colors[i]
        data = dictdata[condition]
        
        try:
            n = len(data)
            theta, r = zip(*data)
        except TypeError:
            theta, r = data
            n = 1
        if withn == 'yes':
            plt.polar(theta, r, 'o', color=datac, label=condition + '\n n=' + str(n))
        if withn == 'no':
            plt.polar(theta, r, 'o', color=datac, label=condition)

        lines, labels = plt.rgrids( (1.0, 1.4), ('', ''), angle=0 )
        tlines, tlabels = plt.thetagrids( (0, 90, 180, 270), ('0', 'pi/2', 'pi', '3pi/2') )
        leg = plt.legend(loc=(0.93,0.8))
  
        for t in leg.get_texts():
            t.set_fontsize('small')
            
        plt.subplots_adjust(top=0.85)
        plt.draw()
开发者ID:acvmanzo,项目名称:mn,代码行数:33,代码来源:genplotlib.py


示例16: flowers

def flowers(n):
    a=[4,5,6,7,0.75,2.5,3.5,5.0/3.0,7.0/3.0,7.0/4.0,1.0/6.0,1.0/8.0,1.0/7.0,2.0/9.0]
    if a[n-1]>=4:
        b='yellow'
    elif a[n-1]<=1:
        b='red'
    else:
        b='magenta'
    pyplot.axes(polar=True)
    pyplot.thetagrids([])
    pyplot.rgrids([2])
    theta = arange(-9, 9, 1./180)*pi # angular coordinates
    figure(1)
    pyplot.plot(theta, cos(a[n-1]*theta), color=b, linewidth=5) # drawing the polar rose
    show()
    return
开发者ID:blitzhunterz,项目名称:grow,代码行数:16,代码来源:flowers.py


示例17: makeSpiderChart

def makeSpiderChart(jobID, savedLengths, outputDir):
    	
	#setting up the directory to save the chart in
	cwd = os.getcwd()
	prefix = "".join([cwd,'/',jobID,'_SignificantWords.png'])

	#local variables
	data = []
	labels = []
	largestWords = 0
	
	#assiging values to lists for the spider chart
	for key, value in savedLengths.items():
		data.append(value)
		labels.append(key)
		if value > largestWords:
			largestWords = value

	N = len(labels)
    	theta = radar_factory(N, frame='circle')
    	spoke_labels = labels

    	#size of the file
    	fig = plt.figure(figsize=(13, 13))
    
    	fig.subplots_adjust(wspace=0.25, hspace=0.20, top=0.85, bottom=0.05)

    	color = 'b'
    	# Plot the four cases from the example data on separate axes
    	ax = fig.add_subplot(2, 2, 1, projection='radar')
    	plt.rgrids([1, (largestWords*0.25), (largestWords*0.5), (largestWords*0.75), largestWords])
    	ax.set_title(jobID, weight='bold', size='medium', position=(0.5, 1.1), horizontalalignment='center', verticalalignment='center')
    	ax.plot(theta, data, color)
    	ax.fill(theta, data, color, alpha=0.25)
    	ax.set_varlabels(spoke_labels)

    	# add legend relative to top-left plot
    	plt.subplot(2, 2, 1)
    	labels = ('Significant Words', 'Fill')
    	legend = plt.legend(labels, loc=(0.9, .95), labelspacing=0.1)
    	plt.setp(legend.get_texts(), fontsize='small')

    	plt.figtext(0.5, 0.965, 'Significant Words for Interesting Word Lengths',
        	ha='center', color='black', weight='bold', size='large')
    	
	savefig(prefix)
	shutil.move(prefix, outputDir)
开发者ID:MaxRego,项目名称:CodeSamples,代码行数:47,代码来源:openmotif_main.py


示例18: plot

def plot(data, spoke_labels, sensor_labels,saveto=None,frame_type='polygon'):
    theta = radar_factory(len(spoke_labels), frame=frame_type)
    fig = plt.figure(figsize=(9, 9))
    fig.subplots_adjust(wspace=0.25, hspace=0.20, top=0.85, bottom=0.05)
    ax = fig.add_subplot(111, projection="radar")
    plt.rgrids([np.round(0.1 + i / 10.0,2) for i in range(10)])
    for d in data:
        ax.plot(theta, d)
        ax.fill(theta, d, alpha=0.2)
    
    ax.set_varlabels(spoke_labels)
    
    legend = plt.legend(sensor_labels, loc=(0.0, 0.9), labelspacing=0.1)
    plt.setp(legend.get_texts(), fontsize='small')
    
    if saveto != None:
        plt.savefig(saveto)
开发者ID:TinyOS-Camp,项目名称:DDEA-DEV,代码行数:17,代码来源:radar_chart.py


示例19: main

def main():
    azi = np.random.uniform(0, 180, 100000)
    azi = azi.tolist()
    azi.append(359.)
    azi = np.array(azi)
    z = np.cos(np.radians(azi / 2.))

    plt.figure(figsize=(5, 6))
    plt.subplot(111, projection='polar')
    coll = rose(azi, z=z, bidirectional=False)
    plt.xticks(np.radians(range(0, 360, 45)),
               ['N', 'NE', 'E', 'SE', 'S', 'SW', 'W', 'NW'])
    plt.colorbar(coll, orientation='horizontal')
    plt.xlabel('A rose diagram colored by a second variable')
    plt.rgrids(range(5, 20, 5), angle=360)

    plt.show()
开发者ID:Jeronics,项目名称:cac-segmenter,代码行数:17,代码来源:rose_graph.py


示例20: plot_hsi_image

    def plot_hsi_image(self, show_plot=True):

        plt.subplot(221)
        plt.gray()
        plt.imshow(self.hsi_image[:, :, 0] / (2 * 3.14) * 255., interpolation='nearest')
        plt.axis('off')

        plt.subplot(222, projection='polar')
        plt.gray()

        azi = self.hsi_image[:, :, 0] / (2 * 3.14) * 360.
        azi = azi.flatten()
        azi = list(azi)
        azi.append(359.)
        azi = np.array(azi)
        z = np.cos(np.radians(azi / 2.))
        coll = rose_graph.rose(azi, z=z, bidirectional=False, bins=50)
        plt.xticks(np.radians(range(0, 360, 10)),
                   ['Red', '', '', 'Red-Magenta', '', '', 'Magenta', '', '', 'Magenta-Blue', '', '', 'Blue', '', '',
                    'Blue-Cyan', '', '', 'Cyan', '', '', 'Cyan-Green', '', '', 'Green', '', '', 'Green-Yellow', '', '',
                    'Yellow', '', '', 'Yellow-Red', '', ''])
        plt.colorbar(coll, orientation='horizontal')
        plt.xlabel('A rose diagram colored by a second variable')
        plt.rgrids(range(5, 20, 5), angle=360)

        plt.subplot(223)
        plt.imshow(self.hsi_image[:, :, 0] / (2 * 3.14) * 255., cmap=matplotlib.cm.hsv)
        plt.axis('off')

        plt.subplot(224)
        data = self.hsi_image[:, :, 0] / (2 * 3.14) * 255.
        data = data.flatten()
        data = list(data)
        data.append(359.)
        n, bins, patches = plt.hist(data, 36)
        bin_centers = 0.5 * (bins[:-1] + bins[1:])

        col = bin_centers
        col /= 360
        col = col
        print bins
        for c, p in zip(col, patches):
            plt.setp(p, 'facecolor', matplotlib.cm.hsv(c))
        plt.xticks([np.ceil(x) for i, x in enumerate(bins) if i % 3 == 0])
        if show_plot:
            plt.show()
开发者ID:Jeronics,项目名称:cac-segmenter,代码行数:46,代码来源:ImageClass.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python pyplot.savefig函数代码示例发布时间:2022-05-27
下一篇:
Python pyplot.register_cmap函数代码示例发布时间: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