Skip to content

Commit 7511fe1

Browse files
authored
Add files via upload
1 parent 6b03ddb commit 7511fe1

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import networkx as nx
2+
import matplotlib.pyplot as plt
3+
4+
G = nx.Graph()
5+
G.add_nodes_from=['A', 'B', 'C', 'D', 'E']
6+
7+
edges = [('A', 'B'), ('A', 'C'), ('B', 'c'), ('B', 'D'), ('C', 'E')]
8+
G.add_edges_from(edges)
9+
10+
plt.figure(figsize=(8, 6))
11+
nx.draw(G, with_labels=True, node_color='yellow', node_size=1000,
12+
edge_color='gray', font_size=16, font_weight='bold')
13+
plt.title('Network Graph Using Python')
14+
plt.show()
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import matplotlib.pyplot as plt
2+
import numpy as np
3+
4+
x = np.linspace(0, 10, 10)
5+
y = 2 * x + 2
6+
y_errors = np.random.rand(len(x)) * 2
7+
colors = plt.cm.plasma(np.linspace(0, 1, len(x)))
8+
9+
plt.figure()
10+
11+
for i in range(len(x)):
12+
plt.errorbar(
13+
x[i], y[i], yerr=y_errors[i], fmt='*', capsize=5,
14+
color=colors[i], ecolor=colors[i],
15+
elinewidth=2, markersize=8)
16+
17+
plt.xlabel("X Axis")
18+
plt.ylabel("X Axis")
19+
plt.title("Colorful Error Bar Plot")
20+
plt.show()

0 commit comments

Comments
 (0)