我正在使用 openturns 来找到最适合我的数据的分布。我得把它画好,但 X 限制比我想要的要大得多。我的代码是:
import statsmodels.api as sm
import openturns as ot
import openturns.viewer as otv
data = in_seconds
sample = ot.Sample(data, 1)
tested_factories = ot.DistributionFactory.GetContinuousUniVariateFactories()
best_model, best_bic = ot.FittingTest.BestModelBIC(sample, tested_factories)
print(best_model)
graph = ot.HistogramFactory().build(sample).drawPDF()
bestPDF = best_model.drawPDF()
bestPDF.setColors(["blue"])
graph.add(bestPDF)
name = best_model.getImplementation().getClassName()
graph.setLegends(["Histogram",name])
graph.setXTitle("Latências (segundos)")
graph.setYTitle("Frequência")
otv.View(graph)
我想将 X 限制设置为“graph.setXLim”之类的东西,就像我们在 matplotlib 中所做的那样,但我坚持使用它,因为我是 OpenTurns 的新手。
提前致谢。