本文整理匯總了Python中pylab.mpl.rcParams方法的典型用法代碼示例。如果您正苦於以下問題:Python mpl.rcParams方法的具體用法?Python mpl.rcParams怎麽用?Python mpl.rcParams使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pylab.mpl
的用法示例。
在下文中一共展示了mpl.rcParams方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: violinPlot
# 需要導入模塊: from pylab import mpl [as 別名]
# 或者: from pylab.mpl import rcParams [as 別名]
def violinPlot(all_data,eps):
fig, axes = plt.subplots(nrows=1, ncols=2, figsize=(18*2, 8*2))
# plot violin plot
axes[0].violinplot(all_data,showmeans=False,showmedians=True)
axes[0].set_title('Violin plot',fontsize=30)
# plot box plot
axes[1].boxplot(all_data,flierprops={'marker':'o','markerfacecolor':'red','color':'black'})
axes[1].set_title('Box plot',fontsize=30)
# adding horizontal grid lines
for ax in axes:
ax.yaxis.grid(True)
ax.set_xticks([y + 1 for y in range(len(all_data))])
ax.set_xlabel('聚類距離',fontsize=30)
ax.set_ylabel('均衡度',fontsize=30)
ax.spines['top'].set_visible(False)
ax.spines['right'].set_visible(False)
# add x-tick labels
plt.setp(axes, xticks=[y + 1 for y in range(len(all_data)) if y%2==0],xticklabels=[eps[i] for i in range(len(eps)) if i%2==0])
fig.autofmt_xdate()
plt.rcParams['font.sans-serif']=['STXihei']
plt.tick_params(labelsize=20)
plt.show()
示例2: violinPlot
# 需要導入模塊: from pylab import mpl [as 別名]
# 或者: from pylab.mpl import rcParams [as 別名]
def violinPlot(all_data,estimators):
fig, axes = plt.subplots(nrows=1, ncols=2, figsize=(8*4, 8*2))
# plot violin plot
axes[0].violinplot(all_data,showmeans=False,showmedians=True)
axes[0].set_title('Violin plot',fontsize=30)
# plot box plot
axes[1].boxplot(all_data,flierprops={'marker':'o','markerfacecolor':'red','color':'black'})
axes[1].set_title('Box plot',fontsize=30)
# adding horizontal grid lines
for ax in axes:
ax.yaxis.grid(True)
ax.set_xticks([y + 1 for y in range(len(all_data.T))])
ax.set_xlabel('回歸模型',fontsize=30)
ax.set_ylabel('F1_score',fontsize=30)
ax.spines['top'].set_visible(False)
ax.spines['right'].set_visible(False)
# add x-tick labels
plt.setp(axes, xticks=[y + 1 for y in range(len(all_data.T)) if y%1==0],xticklabels=[estimators[i] for i in range(len(estimators)) if i%1==0])
# plt.setp(axes)
fig.autofmt_xdate()
plt.rcParams['font.sans-serif']=['STXihei']
plt.tick_params(labelsize=20)
plt.show()
示例3: violinPlot
# 需要導入模塊: from pylab import mpl [as 別名]
# 或者: from pylab.mpl import rcParams [as 別名]
def violinPlot(all_data,eps):
fig, axes = plt.subplots(nrows=1, ncols=2, figsize=(18*2, 8*2))
# plot violin plot
axes[0].violinplot(all_data,showmeans=False,showmedians=True)
axes[0].set_title('Violin plot',fontsize=30)
# plot box plot
axes[1].boxplot(all_data,flierprops={'marker':'o','markerfacecolor':'red','color':'black'})
axes[1].set_title('Box plot',fontsize=30)
# adding horizontal grid lines
for ax in axes:
ax.yaxis.grid(True)
ax.set_xticks([y + 1 for y in range(len(all_data))])
ax.set_xlabel('聚類距離',fontsize=30)
ax.set_ylabel('聚類頻數(標準化)',fontsize=30)
ax.spines['top'].set_visible(False)
ax.spines['right'].set_visible(False)
ax.tick_params(labelsize=20)
# add x-tick labels
plt.setp(axes, xticks=[y + 1 for y in range(len(all_data)) if y%2==0],xticklabels=[eps[i] for i in range(len(eps)) if i%2==0])
fig.autofmt_xdate()
# plt.tick_params(labelsize=20)
# plt.rcParams('font.sans-serif')=['STXihei'] #在開始已經設置mpl.rcParams['font.sans-serif']=['STXihei'],因此此處可忽略
plt.savefig(os.path.join(savingFig,"violinPlot"))
plt.show()