-
Notifications
You must be signed in to change notification settings - Fork 2
BarCharts
avivDan edited this page Jan 13, 2021
·
3 revisions
If you want to see how we build the charts and build your own bar Chart here's how you'll do it:
# You have three options and they are in pairs (commented)
# copy and paste them to place
# you can also change headline name
def build_bar_chart():
labels = ["G_10_80_1", "G_100_800_1", "G_1000_8000_1", "G_10000_80000_1", "G_20000_160000_1", "G_30000_240000_1"]
java_sccs = [0, 0, 0.002, 0.047, 0.106, 0.166] # 1 //copy
python_sccs = [0, 0, 0, 0.004, 0.25, 0.476] # 1
java_Dijkstra = [0, 0, 0.65, 41.938, 192.605, 353.267] # 2
python_Dijkstra = [0, 0.002, 0.742, 7.14, 35.856, 89.654] # 2
java_scc = [0, 0.004, 0.731, 131.712, 617.267, 1419.259] # 3
python_scc = [0, 0, 0, 0.904, 4.11, 11.078] # 3
name = "sccs" # to change headline name to whatever you want change what written in the ""
x = np.arange(len(labels)) # the label locations
width = 0.35 # the width of the bars
fig, ax = plt.subplots()
rects1 = ax.bar(x - width / 2, java_YourOption, width, label='java') #option java //place
rects2 = ax.bar(x + width / 2, python_YourOption, width, label='python') #option python
# Add some text for labels, title and custom x-axis tick labels, etc.
ax.set_ylabel('Time Measure')
ax.set_title(name)
ax.set_xticks(x)
ax.set_xticklabels(labels)
ax.legend()
# uncomment build_bar_chart and run
if __name__ == '__main__':
# check_runtime()
# networkX()
build_bar_chart()
# create_random_graph(nodes=10)
print("wow")
My Laptop have the specs of:
i5 6200u
integrated Intel graphics card - nothing
16 GB of ram 2133 MHz
and it's mat black
A0 graph from last assignment
