def test_Subplot(): fig = plt.figure() ax = Subplot(fig, 1, 1, 1) fig.add_subplot(ax) xx = np.arange(0, 2 * np.pi, 0.01) ax.plot(xx, np.sin(xx)) ax.set_ylabel("Test") ax.axis["top"].major_ticks.set_tick_out(True) ax.axis["bottom"].major_ticks.set_tick_out(True) ax.axis["bottom"].set_label("Tk0")
def lineGraph(all_data, eps): fig = plt.figure(1, (18 * 2, 9 * 2)) ax = Subplot(fig, 111) fig.add_subplot(ax) ax.plot(eps, all_data, 'ro-', label='POI聚类总数') ax.axis["right"].set_visible(False) ax.axis["top"].set_visible(False) ax.set_xlabel('聚类距离', fontsize=30) ax.set_ylabel('聚类总数', fontsize=30) ax.tick_params(labelsize=20) plt.legend() plt.savefig(os.path.join(savingFig, "lineGraph")) plt.show()
def test_Subplot(): # Remove this line when this test image is regenerated. plt.rcParams['text.kerning_factor'] = 6 fig = plt.figure() ax = Subplot(fig, 1, 1, 1) fig.add_subplot(ax) xx = np.arange(0, 2 * np.pi, 0.01) ax.plot(xx, np.sin(xx)) ax.set_ylabel("Test") ax.axis["top"].major_ticks.set_tick_out(True) ax.axis["bottom"].major_ticks.set_tick_out(True) ax.axis["bottom"].set_label("Tk0")
values["server_type"] = server_type_category[server_type_index][0] # ax = axes[int(cpu_count_index / 2), cpu_count_index % 2] values["cpu_number"] = first_image_vcpu_count[cpu_count_index] result = [] for cpu_frequency_index in range(0, len(first_image_frequency_x)): values["cpu_frequency"] = first_image_frequency_x[ cpu_frequency_index] cursor_DictCursor.execute(select_record, values) print(values) select_result = cursor_DictCursor.fetchall() print(select_result) result.append(float(select_result[0]['kernel_run_time'])) print() print() ax.plot(first_image_frequency_x, result, color=line_color[server_type_index], marker='v') # 设置上边和右边无边框 ax.axis['right'].set_visible(False) ax.axis['top'].set_visible(False) ax.axis['left'].set_axisline_style('->') ax.axis['bottom'].set_axisline_style('->') ax.set_xticks(np.array(first_image_frequency_x)) ax.set_xlabel("GHz") ax.set_ylabel("MB/s") ax.set_title('the number of VCPU is ' + str(first_image_vcpu_count[cpu_count_index])) print(result)
""" 胸径树高频率频数分布拟合 """ x = np.array(df['胸径']) fig = plt.figure(figsize=(10, 6)) ax = Subplot(fig, 221) fig.add_subplot(ax) ax.axis["right"].set_visible(False) ax.axis["top"].set_visible(False) n, bins, c = ax.hist(df['胸径'], bins=range(23, 51, 2), edgecolor='black') y = n x = bins[:-1] ztfb = get_curve_fit_param(x, y, func, p0=[5, 35, 6]) ztfbpre = func(x, *ztfb) # ax.plot(x,y,'r*',ls='-') ax.plot(x, ztfbpre, 'b+', ls='-', color='orange') wbfb = get_curve_fit_param(x, y, weib, p0=[20, 20, 5]) wbfbpre = weib(x, *wbfb) # plt.plot(x,y,'r*') ax.plot(x, wbfbpre, 'b+', ls='-') plt.xticks(range(24, 51, 2)) plt.xlabel('径阶分布(cm)') plt.ylabel('频数') plt.yticks([2, 4, 6, 8]) ax1 = Subplot(fig, 222) fig.add_subplot(ax1) ax1.axis["right"].set_visible(False) ax1.axis["top"].set_visible(False) n1, bins1, c1 = ax1.hist(df['树高'], bins=range(11, 23, 1), edgecolor='black') y1 = n1 x1 = bins1[:-1]
# ax = axes[int(cpu_count_index / 2), cpu_count_index % 2] values["cpu_number"] = first_image_vcpu_count[cpu_count_index] result = [] for cpu_frequency_index in range(0, len(first_image_frequency_x)): values["cpu_frequency"] = first_image_frequency_x[ cpu_frequency_index] cursor_DictCursor.execute(select_record, values) print(values) select_result = cursor_DictCursor.fetchall() print(select_result) result.append(float(select_result[0]['linpack_run_time'])) print() print() line = ax.plot(np.array(first_image_frequency_x) / 10.0, result, color=line_color[server_type_index], marker='v', lw=2)[0] line_list.append(line_list) # 设置上边和右边无边框 ax.axis['right'].set_visible(False) ax.axis['top'].set_visible(False) ax.axis['left'].set_axisline_style('->') ax.axis['bottom'].set_axisline_style('->') ax.set_xticks(np.array(first_image_frequency_x) / 10.0) ax.set_xlabel("CPU Frequency(GHz)") ax.set_ylabel("Runtime(s)") ax.set_title('the number of VCPU is ' + str(first_image_vcpu_count[cpu_count_index]),