本文整理汇总了Python中Stoner.Data.ylim方法的典型用法代码示例。如果您正苦于以下问题:Python Data.ylim方法的具体用法?Python Data.ylim怎么用?Python Data.ylim使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Stoner.Data
的用法示例。
在下文中一共展示了Data.ylim方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Data
# 需要导入模块: from Stoner import Data [as 别名]
# 或者: from Stoner.Data import ylim [as 别名]
"""Re-binning data example."""
from Stoner import Data
from Stoner.plot.utils import errorfill
d = Data("Noisy_Data.txt", setas="xy")
d.template.fig_height = 6
d.template.fig_width = 8
d.figure(figsize=(6, 8))
d.subplot(411)
e = d.bin(bins=0.05, mode="lin")
f = d.bin(bins=0.25, mode="lin")
g = d.bin(bins=0.05, mode="log")
h = d.bin(bins=50, mode="log")
for i, (binned, label) in enumerate(
zip([e, f, g, h], ["0.05 Linear", "0.25 Linear", "0.05 Log", "50 log"])
):
binned.subplot(411 + i)
d.plot()
binned.fig = d.fig
binned.plot(plotter=errorfill, label=label)
d.xlim = (1, 6)
d.ylim(-0.1, 0.4)
d.title = "Bin demo" if i == 0 else ""
d.tight_layout()
示例2: fit
# 需要导入模块: from Stoner import Data [as 别名]
# 或者: from Stoner.Data import ylim [as 别名]
VFTEquation,
x=0.5,
y=0.35,
prefix="VFTEquation",
fontdict={"size": "x-small", "color": "green"},
mode="eng",
)
# reset the columns for the fit
d.setas = "xye.."
# Now do the odr fit (will overwrite lmfit's metadata)
d.odr(VFTEquation, p0=p0)
d.setas = "x4.y"
# And plot and annotate
d.plot(fmt="m-", label="Orthogonal distance")
d.annotate_fit(
VFTEquation,
x=0.75,
y=0.35,
fontdict={"size": "x-small", "color": "magenta"},
mode="eng",
)
# Finally tidy up the plot a bit
d.yscale = "log"
d.ylim = (1e-35, 1e10)
d.title = "VFT Equation Test Fit"
d.ylabel = "Rate"
d.xlabel = "Temperature (K)"