f872c37f1699d796c4bc535d6f4f5c7c32711403,examples/api/barchart.py,,,#,11
Before Change
import numpy as np
import matplotlib.pyplot as plt
N = 5
men_means = (20, 35, 30, 35, 27)
men_std = (2, 3, 4, 1, 2)
ind = np.arange(N) // the x locations for the groups
width = 0.35 // the width of the bars
fig, ax = plt.subplots()
rects1 = ax.bar(ind, men_means, width, color="r", yerr=men_std)
women_means = (25, 32, 34, 20, 25)
women_std = (3, 5, 2, 3, 3)
rects2 = ax.bar(ind + width, women_means, width, color="y", yerr=women_std)
// add some text for labels, title and axes ticks
ax.set_ylabel("Scores")
ax.set_title("Scores by group and gender")
ax.set_xticks(ind + width / 2)
ax.set_xticklabels(("G1", "G2", "G3", "G4", "G5"))
ax.legend((rects1[0], rects2[0]), ("Men", "Women"))
def autolabel(rects):
After Change
fig, ax = plt.subplots()
rects1 = ax.bar(ind - width/2, men_means, width, yerr=men_std,
color="SkyBlue", label="Men")
rects2 = ax.bar(ind + width/2, women_means, width, yerr=women_std,
color="IndianRed", label="Women")
// Add some text for labels, title and custom x-axis tick labels, etc.
ax.set_ylabel("Scores")
ax.set_title("Scores by group and gender")
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances
Project Name: matplotlib/matplotlib
Commit Name: f872c37f1699d796c4bc535d6f4f5c7c32711403
Time: 2017-12-01
Author: vincent.adrien@gmail.com
File Name: examples/api/barchart.py
Class Name:
Method Name:
Project Name: snorkel-team/snorkel
Commit Name: 03a1277361e9a8578c53095b0a077473fcc941d5
Time: 2016-09-10
Author: hancock.braden@gmail.com
File Name: snorkel/parser.py
Class Name: CorpusParser
Method Name: parse_corpus
Project Name: dmnfarrell/pandastable
Commit Name: 48aa0ca0313845f1fd40e4d263173369765c6eec
Time: 2014-02-23
Author: farrell.damien@gmail.com@c7c09e87-b3be-f776-313c-63292bcc8aec
File Name: plotting.py
Class Name: PlotViewer
Method Name: plot3D