本文整理汇总了Python中Stoner.Data.stitch方法的典型用法代码示例。如果您正苦于以下问题:Python Data.stitch方法的具体用法?Python Data.stitch怎么用?Python Data.stitch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Stoner.Data
的用法示例。
在下文中一共展示了Data.stitch方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Data
# 需要导入模块: from Stoner import Data [as 别名]
# 或者: from Stoner.Data import stitch [as 别名]
"""Scale data to stitch it together."""
from Stoner import Data
from Stoner.Util import format_error
import matplotlib.pyplot as plt
# Load and plot two sets of data
s1 = Data("Stitch-scan1.txt", setas="xy")
s2 = Data("Stitch-scan2.txt", setas="xy")
s1.plot(label="Set 1")
s2.fig = s1.fig
s2.plot(label="Set 2")
# Stitch scan 2 onto scan 1
s2.stitch(s1)
s2.plot(label="Stictched")
s2.title = "Stictching Example"
# Tidy up the plot by adding annotation fo the stirching co-efficients
labels = ["A", "B", "C"]
txt = []
lead = r"$x'\rightarrow x+A$" + "\n" + r"$y'=\rightarrow By+C$" + "\n"
for l, v, e in zip(
labels, s2["Stitching Coefficients"], s2["Stitching Coeffient Errors"]
):
txt.append(format_error(v, e, latex=True, prefix=l + "="))
plt.text(0.7, 0.65, lead + "\n".join(txt), fontdict={"size": "x-small"})
plt.draw()