Created
March 28, 2013 14:28
-
-
Save andrewgiessel/5263554 to your computer and use it in GitHub Desktop.
plot mean +/- SEM in matplotlib
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scipy | |
def plot_mean_and_sem(array, axis=1): | |
mean = array.mean(axis=axis) | |
sem_plus = mean + scipy.stats.sem(array, axis=axis) | |
sem_minus = mean - scipy.stats.sem(array, axis=axis) | |
fill_between(np.arange(mean.shape[0]), sem_plus, sem_minus, alpha=0.5) | |
plot(mean) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment