Created
September 16, 2018 14:06
-
-
Save pozitron57/51aaab74b0a8033cfc44e3cb91b473be to your computer and use it in GitHub Desktop.
Literacy vs. physics level
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
#! /usr/bin/env python | |
#coding=utf8 | |
import numpy as np | |
from matplotlib import rc, rcParams | |
import matplotlib.pyplot as plt | |
from matplotlib.ticker import AutoMinorLocator, MultipleLocator | |
# Plot Setup {{{ | |
rcParams['font.size'] = 16. | |
rcParams['font.sans-serif'] = ['Times New Roman'] | |
rc('axes', linewidth=1.2) | |
rc('xtick.major', size=1, width=1.2) | |
rc('ytick.major', size=4, width=1.2) | |
rc('ytick.minor', size=3, width=0.9) | |
fig, ax = plt.subplots() | |
ax2 = ax.twinx() | |
#}}} | |
prenebrech_ = np.array([5,4,5,5,4,5,4,5,5,5,5,4,5,4,4,5,5,5,4,5,4,4,4,4,5,5,5,5,5,5,4,4,5,3,3,4,5,5,5,3,3,5,4,3,4,5,5,3,4,4,4]) | |
prinebrech_ = np.array([5,4,5,5,4,4,4,4,5,5,3,3,5,4,5,5,4,3,4,4]) | |
prenebrech = np.array([3,4,3]) | |
#prinebrech = np.array([5]) | |
points = np.array([ | |
np.average(prenebrech_), | |
np.average(prinebrech_), | |
np.average(prenebrech), | |
#np.average(prinebrech), | |
]) | |
num_works = len(prenebrech_) + len(prenebrech) + len(prinebrech_) | |
print ('Количество проанализированных работ:',num_works) | |
#variant = ('Пренебречь', 'Принебречь', 'Пренебреч', 'Принебреч') | |
variant = ('Пренебречь', 'Принебречь', 'Пренебреч') | |
y_pos = np.arange(len(variant)) | |
ax.bar(y_pos, points, align='center', alpha=0.9, fc='#888888', ec='#333333') | |
plt.xticks(y_pos, variant) | |
ax.set_ylim([2,5]) | |
ax2.set_ylim([2,5]) | |
ax.set_ylabel('Средний балл') | |
ax.set_title('Средний балл в зависимости от\n написания слова «пренебречь»') | |
ax.yaxis.set_major_locator(MultipleLocator(1)) | |
ax.yaxis.set_minor_locator(AutoMinorLocator(5)) | |
ax2.yaxis.set_major_locator(MultipleLocator(1)) | |
ax2.yaxis.set_minor_locator(AutoMinorLocator(5)) | |
plt.savefig('/home/slisakov/Desktop/neglect.jpg', dpi=120) | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment