500*_*500 3 statistics plot wolfram-mathematica mathematica-8
请考虑 :
Needs["ErrorBarPlots`"];
fixNumberF1F6 = {{{7.11`, 7.51`, 11.14`, 8.19`, 6.58`},
{2.14`, 2.33`,2.25`, 1.53`,1.71`}},
{{4.69`, 4.79`, 3.78,4.34`, 4.8`},
{2.22`, 2.71`, 3.18`, 2.29`, 1.93`}}}
Run Code Online (Sandbox Code Playgroud)
fixNumberF1F6 [[1,1]]是指条件1的每个受试者的平均固定数,fixNumberF1F6 [[1,2]]是这些均值的标准偏差.fixNumberF1F6 [[2]]指的是条件2.
plotOptionsXX[title_, yName_, xName_, colors_: Black] :=
{Frame -> {{True, False}, {True, False}},
PlotStyle -> colors,
PlotLabel ->
Style[title, Bold, 14, Opacity[1], FontFamily -> "Helvetica"],
PlotStyle -> Directive[Black, PointSize[Medium]],
PlotRangePadding -> 0,
Frame -> {{True, False}, {True, False}},
LabelStyle -> Directive[Black, Bold, 12],
FrameLabel -> {{Style[yName, Opacity[1]],
None}, {Style[xName, Opacity[1]], None}},
FrameStyle -> Opacity[0],
FrameTicksStyle -> Opacity[1],
AxesStyle -> Directive[Black, 12],
ImageSize -> laTaille};
ErrorListPlot[fixNumberF1F6[[#]] // Transpose,
PlotRange -> {{0, 6}, {0, 15}},
ImageSize -> 300,
FrameTicks ->{{Range[1, 13, 2], None},{{1, 2, 3, 4, 5}, None}},
PlotStyle -> Directive[Black, AbsolutePointSize[10], AbsoluteThickness[2]],
plotOptionsXX["Mean Fixation number", "Fixation Nuber", "SubNo"]] & /@ Range[2]
Run Code Online (Sandbox Code Playgroud)
左侧的图表表示每个受试者的平均固定数量以及条件1的标准偏差.在条件2的右侧.
我如何在1个情节中绘制它们?
如果这 :
fixNumberF1F6across = {{8.10, 1.99}, {4.48, 2.46}}
Run Code Online (Sandbox Code Playgroud)
是主题的平均值和标准差,我怎么能显示两者?
- 我如何在不同科目的类似情节中显示2个条件 - 如何显示组平均值和SD值.
编辑:
我从头开始.鉴于数据如何简单和干净,它可能是最容易使用ListPlot
和添加条形图Epilog
.
你仍然可以稍微调整它 - 例如在蓝色和红色数据点和条之间留一个小空间,添加一个图例等,但基本的想法就在那里.
data = {{{7.11`, 7.51`, 11.14`, 8.19`, 6.58`}, {2.14`, 2.33`, 2.25`, 1.53`, 1.71`}}, {{4.69`, 4.79`, 3.78, 4.34`, 4.8`}, {2.22`, 2.71`, 3.18`, 2.29`, 1.93`}}};
ListPlot[{data[[1, 1]], data[[2, 1]]},
PlotStyle -> {{PointSize[.025], Red}, {PointSize[0.025], Blue}},
Frame -> True,
PlotRange -> {{0.5, 5.5}, {0, 14}},
FrameTicks -> {{Automatic, Automatic}, {Range[5], None}},
FrameLabel -> {{"Fixation (ms)", None}, {"Subject", None}},
Epilog -> {{Red, Thickness[0.003], Dashed,
Line[{{0, m1 = Mean@data[[1, 1]]}, {5.5, m1}}],
Blue, Line[{{0, m1 = Mean@data[[2, 1]]}, {5.5, m1}}]},
Thickness[0.005], Red,
Line[{{#[[1]], #[[2, 1]]}, {#[[1]], #[[2, 2]]}}] & /@
Transpose@{Range[5], ({#[[1]] + #[[2]], #[[1]] - #[[2]]} & /@
Transpose@data[[1]])},
Thickness[0.005], Blue,
Line[{{#[[1]], #[[2, 1]]}, {#[[1]], #[[2, 2]]}}] & /@
Transpose@{Range[5], ({#[[1]] + #[[2]], #[[1]] - #[[2]]} & /@
Transpose@data[[2]])},
}]
Run Code Online (Sandbox Code Playgroud)
在BoxWhiskerChart
下面是从您的数据.如果这看起来有点像你感兴趣的东西,它可以被修改,以便从第25百分位到75%百分位的扩散被改变,以反映一个sd在均值之上和之下的扩散.
并且,是的,很容易将组平均值(N = 5)叠加到图表上.
[围绕均值没有完美对称的原因是我使用你的均值和标准差来生成原始数据,假设正态分布.我每次试用时只使用了100个数据点,所以有点偏斜是很自然的.如果我们调整图表以反映对称的标准偏差,就不会发生这种情况.
对于任意数量的系列:
plotseries[a_] :=
Module [{col = ColorData[22, "ColorList"]},
Plot[Evaluate@(Piecewise[{#[[2]], #[[1]] - 1/3 <= x <= #[[1]] + 1/3} & /@
Thread[List[Range@Length@#, #]]] & /@
({a[[#, 1]] + a[[#, 2]], a[[#, 1]] - a[[#, 2]]}) & /@
(Range@Length@a)), {x, 0, 1 + Length@(a[[1, 1]])},
ClippingStyle -> None,
PlotStyle -> {None},
Exclusions -> False,
Filling -> ({2 # - 1 -> {{2 #}, Directive[col[[#]], Opacity[.2]]}} & /@
Range@Length@a),
Ticks -> {Range@Length[a[[1, 1]]], Range@#2 &},
AxesLabel -> {Style["Subject", Medium, Bold], Style["Fixation Time", Medium, Bold]},
Epilog ->
MapIndexed[{Directive[col[[#2[[1]]]], PointSize[.03]],
Point@Thread[List[Range@Length[#1[[1]]], #1[[1]]]]} &, a]
]
]
b = Table[{Table[j^(i/3) + i, {j, 6}], Table[1, {j, 6}]}, {i, 1, 3}];
plotseries[b]
Run Code Online (Sandbox Code Playgroud)