from pywikibot import Site
s = Site('meta', 'meta')
logaction_types = {}
for ev in s.logevents(user='Shanmugamp7', start='20160401000000', end='20160430000000', reverse=True):
    logaction_types[ev.type()] = logaction_types.get(ev.type(), 0) + 1
from jinja2 import Template
user_template = """
== [[User:<%= username %>|<%= username %>]] ==
{{ #invoke:Chart | bar chart
| height = 350
| width = 900
| stack = 1
<% for k, v in items %>
| group <%= loop.index %> = 124
<% end %>
| colors = #fda16e : #6bba6f: yellow : #ff6d6d : #996dc6 : #20B2AA : red
| group names = Global IP log : Global Account log : Global rights log : mwoauthconsumer : User rights : Global renames : supress
| units suffix = actions
| x legends = April
}}

"""
import seaborn as sns
sns.barplot(x=list(logaction_types.keys()), y=list(logaction_types.values()))
<matplotlib.axes._subplots.AxesSubplot at 0x7f2996f7bc50>