python – 在matplotlib中设置errorbars的显示范围suplot
发布时间:2020-12-20 11:21:56 所属栏目:Python 来源:网络整理
导读:我正在尝试使用matplot lib绘制我的数据.我有3个separetes数据集我想在3个子图中绘制(我使用 this是我的指导): plt.figure()fig,axs = plt.subplots(nrows=3,ncols = 1,sharex=False)ax1 = axs[0]ax1.errorbar(X,Y,Err,fmt='o')ax1.set_xscale('log')ax1.se
我正在尝试使用matplot lib绘制我的数据.我有3个separetes数据集我想在3个子图中绘制(我使用
this是我的指导):
plt.figure() fig,axs = plt.subplots(nrows=3,ncols = 1,sharex=False) ax1 = axs[0] ax1.errorbar(X,Y,Err,fmt='o') ax1.set_xscale('log') ax1.set_yscale('log') ax1.set_title('epsilon=1.5,kappa = 2') plt.show() 但是我得到的x范围从1(或0,我不确定)到100,我想减少它.我试过this,添加使用: ax1.xlim(0.5,13.5) 但是我收到一个错误:
我怎样才能改变范围呢? 解决方法
您可能想要使用Axes.axis(* v,** kwargs):
ax1.axis(xmin=0.5,xmax=13.5) 从文档:
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |