-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplot_graph.py
More file actions
89 lines (63 loc) · 2.05 KB
/
Copy pathplot_graph.py
File metadata and controls
89 lines (63 loc) · 2.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
import matplotlib.pyplot as plt
import numpy as np
def plot_graph_1():
print("Plotting a graph with 3 subplots: sin, cos, tan")
# Create sample data
x = np.linspace(0, 10, 100)
y1 = np.sin(x)
y2 = np.cos(x)
y3 = np.tan(x)
# Create a figure and 3 subplots in 1 row with a figure size of 12x8 inches
fig, ax = plt.subplots(1, 3, figsize=(12, 8))
# Plot data on each subplot
ax[0].plot(x, y1)
ax[0].set_title("Sine")
ax[1].plot(x, y2)
ax[1].set_title("Cosine")
ax[2].plot(x, y3)
ax[2].set_title("Tangent")
# Display the figure
plt.tight_layout() # Adjust subplots to fit into the figure area.
plt.show()
def plot_graph_2():
print("Plotting a graph with 3 subplots: sinh, cosh, tanh")
# Create sample data
x = np.linspace(0, 10, 100)
y1 = np.sinh(x)
y2 = np.cosh(x)
y3 = np.tanh(x)
# Create a figure and 3 subplots in 1 row with a figure size of 12x8 inches
fig, ax = plt.subplots(1, 3, figsize=(12, 8))
# Plot data on each subplot
ax[0].plot(x, y1)
ax[0].set_title("Sine Hyperbolic")
ax[1].plot(x, y2)
ax[1].set_title("Cosine Hyperbolic")
ax[2].plot(x, y3)
ax[2].set_title("Tangent Hyperbolic")
# Display the figure
plt.tight_layout() # Adjust subplots to fit into the figure area.
plt.show()
def plot_graph_3():
print("Plotting a graph with 3 subplots: arcsin, arccos, arctan")
# Create sample data
x = np.linspace(0, 10, 100)
y1 = np.arcsin(x)
y2 = np.arccos(x)
y3 = np.arctan(x)
# Create a figure and 3 subplots in 1 row with a figure size of 12x8 inches
fig, ax = plt.subplots(1, 3, figsize=(12, 8))
# Plot data on each subplot
ax[0].plot(x, y1)
ax[0].set_title("Arc Sin")
ax[1].plot(x, y2)
ax[1].set_title("Arc Cosin")
ax[2].plot(x, y3)
ax[2].set_title("Arc Tangent")
# Display the figure
plt.tight_layout() # Adjust subplots to fit into the figure area.
plt.show()
if __name__ == "__main__":
plot_graph_1()
plot_graph_2()
plot_graph_3()