#!/usr/bin/env python3 # # Copyright (C) 2022 Jonathan A. Poritz # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # import numpy as np import matplotlib.pyplot as plt import math # numbers below hard-coded from the output of the make_graphs.py scrit when # run in Jan 2022! will have to be recoded if the data is updated! allbmean=[58.34, 57.73, 52.03, 43.28, 57.99] allbstdev=[24.55, 16.1, 17.76, 18.94, 24.21] allbn=203 allbCI=[1.96*sig/math.sqrt(allbn) for sig in allbstdev] allamean=[82.63, 80.27, 80.35, 65.06, 79.98] allastdev=[13.55, 12.71, 13.92, 13.42, 17.3] allan=74 allaCI=[1.96*sig/math.sqrt(allan) for sig in allastdev] edbmean=[54.18, 52.6, 50.66, 41.61, 54.43] edbstdev=[24.41, 15.27, 18.53, 20.04, 23.69] edbn=82 edbCI=[1.96*sig/math.sqrt(edbn) for sig in edbstdev] edamean=[83.12, 77.88, 81.47, 64.29, 77.27] edastdev=[13.37, 13.39, 13.25, 14.45, 17.28] edan=22 edaCI=[1.96*sig/math.sqrt(edan) for sig in edastdev] libbmean=[61.13, 61.5, 52.46, 44.21, 61.02] libbstdev=[24.57, 15.59, 17.41, 18.1, 24.02] libbn=111 libbCI=[1.96*sig/math.sqrt(libbn) for sig in libbstdev] libamean=[82.35, 81.31, 79.79, 65.41, 81.11] libastdev=[13.74, 12.39, 14.29, 13.07, 17.35] liban=51 libaCI=[1.96*sig/math.sqrt(liban) for sig in libastdev] names = ['Unit 1\nWhat is\nCreative Commons', 'Unit 2\nCopyright Law', 'Unit 3\nAnatomy of a\nCC License', 'Unit 4\nUsing CC Licenses\nand CC-Licensed Works ', 'Unit 5\nCC for Educators,\nLibrarians, GLAM'] fig = plt.figure(figsize = (10, 5)) plt.grid(axis='y') plt.bar(names, allbmean, width = -0.3, color='white', edgecolor='black', linewidth=2, align='edge') plt.errorbar([i-.15 for i in range(5)], allbmean, yerr=allbCI, fmt=".", color="r", capsize=2) plt.bar(names, allamean, width = 0.3, color='white', edgecolor='black', linewidth=2, align='edge') plt.errorbar([i+.15 for i in range(5)], allamean, yerr=allaCI, fmt=".", color="r", capsize=2) plt.title("Mean percentage correct in each unit before and after taking the course,\nall sections combined; error bars show the 95% confidence interval \n ") plt.ylim([0,100]) plt.ylabel("Mean percentage correct before and after the course") plt.show() fig = plt.figure(figsize = (10, 5)) plt.grid(axis='y') plt.bar(names, edbmean, width = -0.3, color='white', edgecolor='black', linewidth=2, align='edge') plt.errorbar([i-.15 for i in range(5)], edbmean, yerr=edbCI, fmt=".", color="r", capsize=2) plt.bar(names, edamean, width = 0.3, color='white', edgecolor='black', linewidth=2, align='edge') plt.errorbar([i+.15 for i in range(5)], edamean, yerr=edaCI, fmt=".", color="r", capsize=2) plt.title("Mean percentage correct in each unit in educator sections before and after\ntaking the course; error bars show the 95% confidence interval \n ") plt.ylim([0,100]) plt.ylabel("Mean percentage correct before and after the course") plt.show() fig = plt.figure(figsize = (10, 5)) plt.grid(axis='y') plt.bar(names, libbmean, width = -0.3, color='white', edgecolor='black', linewidth=2, align='edge') plt.errorbar([i-.15 for i in range(5)], libbmean, yerr=libbCI, fmt=".", color="r", capsize=2) plt.bar(names, libamean, width = 0.3, color='white', edgecolor='black', linewidth=2, align='edge') plt.errorbar([i+.15 for i in range(5)], libamean, yerr=libaCI, fmt=".", color="r", capsize=2) plt.title("Mean percentage correct in each unit in librarian sections before and after\ntaking the course; error bars show the 95% confidence interval \n ") plt.ylim([0,100]) plt.ylabel("Mean percentage correct before and after the course") plt.show()