Skip to content

Commit 8c99a97

Browse files
Add files via upload
1 parent 71e7e86 commit 8c99a97

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import matplotlib.pyplot as plt
2+
3+
# Sample data
4+
x = [1, 2, 3, 4]
5+
y = [2, 4, 6, 8]
6+
7+
# Create a line plot
8+
plt.plot(x, y)
9+
10+
# Add labels and title
11+
plt.xlabel('X-axis')
12+
plt.ylabel('Y-axis')
13+
plt.title('Simple Line Plot')
14+
15+
# Display the plot
16+
plt.show()
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Import the matplotlib.pyplot module
2+
import matplotlib.pyplot as plt
3+
4+
# Create some sample data
5+
x = [1, 2, 3, 4, 5]
6+
y = [2, 4, 6, 8, 10]
7+
z = [10, 8, 6, 4, 2]
8+
9+
# Create a scatter plot of x and y
10+
plt.scatter(x, y, color='red', marker='o', label='x vs y')
11+
12+
# Create a bar chart of x and z
13+
plt.bar(x, z, color='blue', width=0.5, label='x vs z')
14+
15+
# Add a title and axis labels
16+
plt.title('Example of Scatter Plot and Bar Chart')
17+
plt.xlabel('x')
18+
plt.ylabel('y and z')
19+
20+
# Add a legend
21+
plt.legend()
22+
23+
# Show the plot
24+
plt.show()

0 commit comments

Comments
 (0)