Missing errorbars when using yscale('log') at matplotlib

前端 未结 2 579
囚心锁ツ
囚心锁ツ 2021-02-07 22:23

In some cases matplotlib shows plot with errorbars errorneously when using logarithmic scale. Suppose these data (within pylab for example):

s=[19.0, 20.0, 21.0         


        
2条回答
  •  猫巷女王i
    2021-02-07 22:49

    Switch to logarithmic scale, but with this command:

    plt.yscale('log', nonposy='clip')
    

    Analogously, for the x-axis:

    plt.xscale('log', nonposx='clip')
    

    Anyway, if you got a dev version of matplotlib in the last half year, you would have this clipping behavior by default, as discussed in Make nonposy='clip' default for log scale y-axes.

提交回复
热议问题