Quantcast
Viewing all articles
Browse latest Browse all 26

Re: Plotting data by group ?

Remi, there are probably lots of ways to do this. Here's a couple:

If you have the Statistics Toolbox, it's pretty easy to do this using
grpstats and errorbar. You'll have to use hold on to overlay the plots
for the two groups.

Another option if you have the Stistics Toolbox would be to make
boxplots, not just error bars. You might want to make two subplots,
rather than overlaying the two sets of boxes.

If you don't have the Statistics Toolbox, but have a recent version of
MATLAB, you can store your data in a table, and compute the groupwise
means using varfun, then make the plot using errorbar.

Hope this helps.


On 4/7/2015 1:26 PM, Remi Chaussenot wrote:
> Hello,
>
> I am a Neuroscientist trying to create some script on MATLAB to replace
> my truly old Statview program.
>
> All my dataset look like :
> Genotype Number Var1 Var2 Var3 Var4 Var5 Var6
> KO 464 2.85 2.65 0.35 1.5 2.35 3.45
> KO 455 2.06 0.69 0.7 1.45 2.4 3.05
> KO 465 0.89 1.1 0.8 1.45 2.45 2.95
> KO 472 2.17 0.5 0.55 1.45 2.2 2.85
> KO 473 2.52 1.69 0.65 1.4 1.65 2.5
> WT 466 0.24 2.29 0.8 1.25 1.95 2.5
> WT 467 2.03 0.67 0.85 1.6 2.5 3.15
> WT 468 1.28 1.27 0.75 1.55 2.25 2.9
> WT 470 2.08 1.19 0.85 1.4 2.4 3
>
> I was looking for a simple way to plot :
> - the mean of each group (WT or KO in my example) for each Var
> - add the standard error
> - plot on the y-axis Var1 to Var 6 and the x-axis with the label on the
> first columm (Var1 to Var6 in text format)
>
> I find this :
> http://www.icn.ucl.ac.uk/motorcontrol/toolboxes/toolbox_graph.htm
> But it plot only x and y numerical values, or my x value are only "label".
>
> I would like to plot something like that :
> http://www.icn.ucl.ac.uk/motorcontrol/toolboxes/pics/lineplot_1.jpg
> But not with 5, 7, 10, 20 on the x axis, only with "Var1" "Var2" ...
> "Var6".
>
> Did someone have an idea ?
>
> It is really common in my field for the figure in paper, so, i was
> thinking someone made something... ^^
>
> Thank a lot !

Viewing all articles
Browse latest Browse all 26

Trending Articles