Код: Выделить всё
fig, ax = plt.subplots(1,1)
ax.plot(np.linspace(1,500,500),Cumulative_increasing,"-",color="black")
ax.set_xlim(0,500)
ax.set_ylim(0,1)
ax.hlines(0.025,0,500,linestyle='dashed',color="red")
ax.hlines(0.975,0,500,linestyle='dashed',color="red")
ax.vlines(12.5,0,1,linestyle='dashed',color="red")
ax.vlines(487.5,0,1,linestyle='dashed',color="red")
ax.set_title("Cumulative increasing frequencies")
ax.set_xlabel("Poll n°")
ax.set_ylabel("Cumulative frequencies")
ax.set_yticks([*ax.get_yticks(), 0.025, 0.975],labels=[*ax.get_yticklabels(), 0.025, 0.975])
ax.set_xticks([*ax.get_xticks(), 12.5, 487.5],labels=[*ax.get_xticklabels(), 12.5, 487.5])
plt.setp(ax.get_xticklabels()[-2],color='red')
plt.setp(ax.get_xticklabels()[-1],color='red')
plt.setp(ax.get_yticklabels()[-1],color='red')
plt.setp(ax.get_yticklabels()[-2],color='red')
ax.margins(0)
arrow_settings={'boxstyle':"darrow",'pad':0.3,"facecolor":"red",'edgecolor':'k',"alpha":0.7}
ax.text(1/2,2/3,"95% Confidence Interval",fontsize=13,ha='center',transform=ax.transAxes,bbox=arrow_settings)
plt.show()
График
Я пытался изменить ширину настроек стрелки, но это не помогло не компилирую.
Код: Выделить всё
arrow_settings={'boxstyle':"darrow",'pad':0.3,"facecolor":"red",'edgecolor':'k',"alpha":0.7,'width':random_value_to_test}Подробнее здесь: https://stackoverflow.com/questions/790 ... ybboxpatch