def scatter_authors(self, measure="betweenness centrality", thresh=15, **kwargs): """Scatter-plot with position based on interaction and cluster measure, color based on number of comments, and size on avg comment length""" project, show, _ = ac.handle_kwargs(**kwargs) x_measure, y_measure = [" ".join([netw, measure]) for netw in ["interaction", "cluster"]] axes = self.author_frame.plot( kind='scatter', x=x_measure, y=y_measure, c='total comments', s=self.author_frame['word counts'] / self.author_frame[ 'total comments'], cmap="viridis_r", sharex=False, title="Author-activity and centrality in {}".format(project)) for name, data in self.author_frame.iterrows(): if data['total comments'] >= thresh: axes.text(data[x_measure], data[y_measure], name, fontsize=6) ac.fake_legend([50, 100, 250], title="Average wordcount of comments") ac.show_or_save(show)
def scatter_authors_hits(self, thresh=10, **kwargs): """Scatter-plot based on hits-algorithm for hubs and authorities""" project, show, _ = ac.handle_kwargs(**kwargs) hits = self.__hits() axes = hits.plot( kind='scatter', x='hubs', y='authorities', c='total comments', s=hits['word counts'] / hits['total comments'], cmap="viridis_r", sharex=False, title="Hubs and Authorities in {}".format(project)) for name, data in hits.iterrows(): if data['total comments'] >= thresh: axes.text(data['hubs'], data['authorities'], name, fontsize=6) ac.fake_legend([50, 100, 250], title="Average wordcount of comments") ac.show_or_save(show)