piermorel / gramm

Gramm is a complete data visualization toolbox for Matlab. It provides an easy to use and high-level interface to produce publication-quality plots of complex data with varied statistical visualizations. Gramm is inspired by R's ggplot2 library.
MIT License
784 stars 222 forks source link

Help to plot SEM and STD in one figure #75

Closed aleshins closed 5 years ago

aleshins commented 5 years ago

I have 3 variables X,Y, and IDX if I do the following:

g=gramm('x',X,'y',Y,'color',IDX);
g.stat_summary('type','sem','geom',{'point','errorbar'},'setylim',true,'width',0.5,'dodge',0.5);

I have a nice plot with SEM's. But i want to have the plot, where IDX == 1 has SEM error bars and IDX ==2 have STD error bars. Is it possible?

piermorel commented 5 years ago

Hello,

stat_summary only does one type of summary at a time. For want you want to do, you would need to do it in two steps with different data selected using 'subset' with IDX, and using update(). I'm not 100% sure it would work for the different colors though...

Mixing different types of error bars in the same graph is probably not the best idea anyway ;)