【问题标题】:Two-dimensional error bars with ErrorPlotList in Mathematica?Mathematica 中带有 ErrorPlotList 的二维误差线?
【发布时间】:2014-07-23 16:09:22
【问题描述】:

我是 Mathematica 的新手,无法在图表上放置二维误差线。我有一个数据格式的表: (r, sr, x, sx, y, sy) 其中 r、x 和 y 是平均值,sr、sx 和 sy 是标准差。我想绘制 x 与 y 列,并使用 ListPlot 成功地做到了这一点:

Show[
 ListPlot[meanlist[[All, {3, 5}]]], Graphics[Circle[{0, 0}, 20]], 
 PlotRange -> All, AspectRatio -> 1, 
 AxesLabel -> {Style["y [mm]", Bold, Medium], 
   Style["z [mm]", Bold, Medium]},
 AxesOrigin -> {0, 0}]

如果真的有必要,我可以把它留在那里。但是,我还想添加 x 和 y 误差线。我尝试使用 ErrorListPlot 执行此操作:

ErrorListPlot[{{meanlist[[All, {3, 5}]]}, 
  ErrorBar[meanlist[[All, {4, 6}]]]}, 
 PlotRange -> All, AspectRatio -> 1, 
 AxesLabel -> {Style["y [mm]", Bold, Medium], 
   Style["z [mm]", Bold, Medium]},
 AxesOrigin -> {0, 0},
 ErrorBarFunction -> Automatic]

我得到的是以下内容(我在第一行之后截断了两个列表,因为它们很长):

ErrorListPlot[{{{{-5.34473, -9.16194}, {-7.87379, -6.57843},...,
ErrorBar[{{0.501015, 0.72511}, {0.48202, 0.703881},...,
 AxesLabel -> {Style["y [mm]", Bold, Medium], 
   Style["z [mm]", Bold, Medium]},
 AxesOrigin -> {0, 0},
 ErrorBarFunction -> Automatic]

换句话说,它会输出正确配对的坐标和误差量列表,然后是我为图形设置的所有参数,但它实际上并没有创建绘图。我已经包含了 Needs["ErrorBarPlots`"];而且我不确定还有什么问题。有任何想法吗?

【问题讨论】:

    标签: wolfram-mathematica error-list


    【解决方案1】:

    试试这个:

     ErrorListPlot[
          {#[[{3, 5}]], ErrorBar[#[[4]], #[[6]]] } & /@ meanlist ] 
    

    除此之外,当您提供带有无效参数的函数时,您看到的最终结果是典型的mathematica,它会重复您输入的内容而不是报告错误。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-10-06
      • 2012-10-13
      • 1970-01-01
      • 2013-11-17
      • 1970-01-01
      相关资源
      最近更新 更多