绘制不同的条件和在 Mathematica 中同时处理多个主题
请考虑:
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`}}}
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]
左侧的图表示每个受试者的平均注视次数以及条件 1 的标准差。条件 2 的右侧。
我怎样才能将它们都绘制在 1 个图上?
如果这
fixNumberF1F6across = {{8.10, 1.99}, {4.48, 2.46}}
是跨主题的平均值和标准差,我如何才能同时显示两者?
-如何在不同主题的相似图上显示 2 个条件 -我怎样才能向其显示该组的平均值和标准差。
Please Consider :
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`}}}
fixNumberF1F6[[1,1]] refers to the mean fixation number for each subject for condition 1,
fixNumberF1F6[[1,2]] the standard Deviation of those means.
fixNumberF1F6[[2]] refers to condition 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]
The Plot On the Left represent each subject average fixation number along with the standard deviation for condition 1. On the right for condition 2.
How could I plot them both on 1 plot ?
If this :
fixNumberF1F6across = {{8.10, 1.99}, {4.48, 2.46}}
was the mean and SD across subject, How could I show both ?
-How can I show 2 conditions on a similar plot for different subjects
-How could I show the group mean and SD on it to.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
编辑:
我从头开始。鉴于数据简单干净,使用
ListPlot
和通过
Epilog
添加条形。您仍然可以对其进行一些调整 - 例如,在蓝色和红色数据点和条之间放置一点空间,添加图例等,但基本思想就在那里。
下面的
BoxWhiskerChart
来自您的数据。如果这看起来模糊地像您感兴趣的东西,则可以对其进行修改,以便更改从 25% 到 75% 百分位的分布,以反映高于和低于平均值 1 个标准差的分布。而且,是的,很容易将组均值 (N=5) 叠加到图表上。
[平均值周围不完美对称的原因是我使用您的平均值和标准差来生成原始数据,假设呈正态分布。我每次试验只使用 100 个数据点,所以有点偏差是很自然的。如果我们调整图表以反映对称的标准差,则不会发生这种情况。]
Edit:
I started from over. Given how the data are simple and clean, it may be easiest to use
ListPlot
andadd the bars via an
Epilog
.You can still tweak it a bit--e.g. put a slight space between the blue and red data points and bars, add a legend, etc, but the basic idea is there.
The
BoxWhiskerChart
below is from your data. If this looks vaguely like something you are interested in, it could be modified so that the spread from the 25th percentile to the 75% percentile is altered to reflect the spread of one s.d. above and below the mean.And, yes, it is easy to overlay the group means (N=5) onto the Chart.
[The reason there isn't perfect symmetry around the mean is that I used your means and standard deviations to generate raw data, assuming a normal distribution. I only used 100 data points per trial, so a little skewing is natural. This would not happen if we were to tweak the chart to reflect standard deviations, which are symmetrical.]
对于任意数量的系列:
For any number of series:
我不太擅长处理错误图,因此这很可能是一种非标准的数据显示形式,并根据
ErrorBarFunction
文档中的示例匆忙组合在一起。每个点都是不同的主题。
x
坐标是条件 1 的平均值,y
坐标是条件 2 的平均值。矩形边长是各自的标准差。因此,虽然它确实重叠,但如果您谨慎选择颜色(并且没有太多主题),它也许会起作用。I don't work very much with error plots, so this might very well be a non-standard form of displaying the data and hastily put together based on the example in the documentation for
ErrorBarFunction
.Each dot is a different subject. The
x
coordinate is the mean for condition 1 and they
coordinate is the mean for condition 2. The lengths of the sides of the rectangles are the respective standard deviations. So while it does overlap, if you're prudent in choosing colors (and if there aren't too many subjects), it could perhaps work.至于第三个。如果你想显示单个受试者的数据,我不明白你如何谈论群体手段。第四(第五?)问题完全不清楚。我建议您删除这些问题,因为它们似乎并不特定于 Mathematica 编程。
As to the 3rd. I don't see how you can talk about group means if you want to show the data of the individual subjects. The 4th (5th?) question is totally unclear. I suggest you remove those questions as they don't seem to be specific to Mathematica programming.