本文整理汇总了Python中Stoner.Data.setas[2]方法的典型用法代码示例。如果您正苦于以下问题:Python Data.setas[2]方法的具体用法?Python Data.setas[2]怎么用?Python Data.setas[2]使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Stoner.Data
的用法示例。
在下文中一共展示了Data.setas[2]方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: logspace
# 需要导入模块: from Stoner import Data [as 别名]
# 或者: from Stoner.Data import setas[2] [as 别名]
from numpy import logspace, log10
from numpy.random import normal
# Make some data
T = logspace(log10(200), log10(350), 51)
params = (1e16, 0.5, 150)
noise = 0.5
R = vftEquation(T, *params) * normal(size=len(T), scale=noise, loc=1.0)
dR = vftEquation(T, *params) * noise
d = Data(T, R, dR, setas="xy.", column_headers=["T", "Rate"])
# Plot the data points.
d.plot(fmt="r.", label="Data Points")
# Turn on the sigma column (error bars look messy on plot due to logscale)
d.setas[2] = "e"
# Curve_fit on its own
d.curve_fit(vftEquation, p0=params, result=True, header="curve_fit")
# lmfit uses some guesses
p0 = params
d.lmfit(VFTEquation, p0=p0, result=True, header="lmfit")
# Plot these results too
d.setas = "x..yy"
d.plot(fmt=["b-", "g-"])
# Annotate the graph
d.annotate_fit(
vftEquation,
x=0.25,