plt.colorbar(label="Like/Dislike Ratio", orientation="horizontal") plt.show() 输出: 范例2:向多个子图添加单个颜色条。 Python3 # Python Program illustrating# pyplot.colorbar() methodimportmatplotlib.pyplotasplt# creates four Axesfig, axes = plt.subplots(nrows=2, ncols=2)foraxinaxes.flat: im...
bone()pcolor(som.distance_map().T)# plotting the distance map as backgroundcolorbar() t = zeros(len(target),dtype=int) t[target =='A'] =0t[target =='B'] =1# use different colors and markers for each labelmarkers = ['o','s','D'] colors = ['r','g','b']forcnt,xxine...
ax = plt.axes()foriinrange(num_columns):# Use an arrow to project each original feature as a# labeled vector on your principal componentaxesplt.arrow(0,0, xvector[i], yvector[i], color='b', width=0.0005, head_width=0.02, alpha=0.75) plt.text(xvector[i]*1.2, yvector[i]*1.2,...
plt.ylim(self.extent[2], self.extent[3])# plt.vlines(self.ionogram_list[0].time, self.extent[2], self.extent[3], 'r')iflabel: celsius.ylabel('f / MHz')ifcolorbar: old_ax = plt.gca() plt.colorbar( cax = celsius.make_colorbar_cax(), ticks=self.cbar_ticks ).set_label(r...
os.remove(filename)# Save execution time and memoryplt.close() 開發者ID:AlexandreAbraham,項目名稱:nilearn,代碼行數:27,代碼來源:test_img_plotting.py 示例10: test_radardisplay_get_colorbar_label ▲點讚 1▼ deftest_radardisplay_get_colorbar_label():radar = pyart.io.read_cfradial(pyart.testin...
cbar1 = plt.colorbar(plotHandle, label = option) lon = x[np.nanargmax(c)] lat = y[np.nanargmax(c)] at_x, at_y = ax.projection.transform_point(lon, lat, src_crs=ccrs.Geodetic()) plt.annotate('%2.1f'%np.nanmax(c.values), xy=(at_x, at_y),#xytext=(30, 20), textco...
plt.colorbar(im, cax=cax, **kw)# Output file.plt.savefig(output_file) plt.close(fig)print'Output saved to:', output_file 开发者ID:sfarrens,项目名称:python_lib,代码行数:34,代码来源:compare.py 示例4: colorbar ▲点赞 1▼ defcolorbar(self, ax=None, **kwargs):ifaxisNone: ax=self...
cbar = fig.colorbar(cn) cbar.set_label("Star Count") fig.savefig(output_prefix + band_name +"."+ output_extension) plt.close(fig) 开发者ID:astroswego,项目名称:leavitt,代码行数:30,代码来源:position_density_contour_plots.py 示例11: mkHist ...
f.colorbar(cf4, cax=cbar_ax2) plt.savefig('writeup/figures/task_d_eta.png') 开发者ID:markmuetz,项目名称:mtmw14,代码行数:58,代码来源:gyreanalysis.py 示例9: create_fig ▲点赞 1▼ defcreate_fig( file_name, small=True, marker=False, ...
ax.yaxis.set_ticks_position('left') ax.set_xlim(0, nb_atom_per_protein)fortin["basic","polar","hydrophobic","backbone"]: tmp_z = np.zeros(nb_atom_per_protein) tmp_z[type_pos[t]] = z_part[type_pos[t]] plt.bar(np.arange(0,nb_atom_per_protein), tmp_z, color = res_colou...