.. _sphx_glr_auto_examples_plot_user_data.py: =================== choldgraf vs NelleV =================== This short example shows the number of commits per user across time. .. image:: /auto_examples/images/sphx_glr_plot_user_data_001.png :align: center .. rst-class:: sphx-glr-script-out Out:: Updating repository: https://api.github.com/users/choldgraf/events Params: {'since': None, 'per_page': 100} Updating repository: https://api.github.com/users/NelleV/events Params: {'since': None, 'per_page': 100} User Database | 2 Users | 2 projects | .. code-block:: python from watchtower.handlers_ import GithubDatabase import matplotlib.pyplot as plt users = ['choldgraf', 'NelleV'] # Initialize the database db = GithubDatabase(verbose=True) # Update users and print the db for user in users: db.update(user) print(db) # Load the data for plotting users = [db.load(user) for user in users] # Now plot pushes each day fig, ax = plt.subplots(figsize=(10, 5)) for user in users: counts = user.PushEvent.resample('D').count().iloc[:, 0] counts.plot(ax=ax, label=user.user, lw=3) ax.set_title('Commits for users') ax.xaxis.label.set(visible=False) ax.legend() plt.tight_layout() plt.show() **Total running time of the script:** ( 0 minutes 2.998 seconds) .. container:: sphx-glr-footer .. container:: sphx-glr-download :download:`Download Python source code: plot_user_data.py ` .. container:: sphx-glr-download :download:`Download Jupyter notebook: plot_user_data.ipynb ` .. rst-class:: sphx-glr-signature `Generated by Sphinx-Gallery `_