Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Mmabiaa authored Nov 16, 2024
1 parent 6b03ddb commit 7511fe1
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Python_Begginer_Projects/Amazing/Network_Graph.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import networkx as nx
import matplotlib.pyplot as plt

G = nx.Graph()
G.add_nodes_from=['A', 'B', 'C', 'D', 'E']

edges = [('A', 'B'), ('A', 'C'), ('B', 'c'), ('B', 'D'), ('C', 'E')]
G.add_edges_from(edges)

plt.figure(figsize=(8, 6))
nx.draw(G, with_labels=True, node_color='yellow', node_size=1000,
edge_color='gray', font_size=16, font_weight='bold')
plt.title('Network Graph Using Python')
plt.show()
20 changes: 20 additions & 0 deletions Python_Begginer_Projects/Amazing/colorful_error_bar.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import matplotlib.pyplot as plt
import numpy as np

x = np.linspace(0, 10, 10)
y = 2 * x + 2
y_errors = np.random.rand(len(x)) * 2
colors = plt.cm.plasma(np.linspace(0, 1, len(x)))

plt.figure()

for i in range(len(x)):
plt.errorbar(
x[i], y[i], yerr=y_errors[i], fmt='*', capsize=5,
color=colors[i], ecolor=colors[i],
elinewidth=2, markersize=8)

plt.xlabel("X Axis")
plt.ylabel("X Axis")
plt.title("Colorful Error Bar Plot")
plt.show()

0 comments on commit 7511fe1

Please sign in to comment.