如何修复matplotlib中的添加剂变化
Matplotlib在其无限的智慧中希望设定地块的局限性,以泄露尽可能多的信息。因此,如果我正确理解的话,它将在图上找到最大和最小点,确定附近的壁虱,并为这些点准备加法和/或乘法描述。
但是,当某人试图验证公式时,即如果线重叠,这些图可能会产生误导。在上面的示例中,差异左右为1E-10。
我希望拥有一个易于理解的添加剂修复程序。在上面的示例中, +5E7会很好。然后,Yticks必须全部负面。下图显示了我从两个函数中手动减去5E7后的相同关系。更容易理解。
那么,有什么简单的方法可以实现这一目标吗?
Matplotlib, in its infinite wisdom, wants to set the limits of the plots to divulge as much information as possible. Thus, if I understood correctly, it locates the maximum and minimum points on the plot, determines ticks around this vicinity and prepares additive and/or multiplicative descriptions for these points.
However, when someone tries to verify a formula, i.e., would be very happy if the lines overlap, such plots might be misleading. In the above example, the difference is around the order of 1e-10.
What I would prefer is to have an additive fix easy to understand. For the example above, +5e7 would make well. Then, the yticks has to be all negative. The below figure shows the same relation after I manually subtract 5e7 from both functions. Much easier to understand.
So, is there an easy way to achieve this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以首先绘制绘制(而无需实际渲染),然后使用
get_offset
获得偏移(注意:偏移既可以是乘法因子,又可以是附加偏移量>+或-
):You can get the offset by first drawing the plot (without actually rendering it) and then use
get_offset
to get the offset (note: the offset can be both a multiplicative factor and an addivitive offset, where the latter is always preceded by+
or-
):