Created
November 28, 2023 10:01
-
-
Save Priyanku-AI/223fd6821433c3ecc07fc3969b3b4624 to your computer and use it in GitHub Desktop.
How to create line charts?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib.pyplot as plt | |
# Example Data | |
time = [1, 2, 3, 4, 5] # X-axis values (e.g., time) | |
values = [10, 12, 8, 15, 11] # Y-axis values (e.g., some measurement) | |
# Creating the Line Chart | |
plt.plot(time, values, marker='o', linestyle='-') # 'o' for markers, '-' for line style | |
# Adding Labels | |
plt.title('Example Line Chart') | |
plt.xlabel('Time') | |
plt.ylabel('Values') | |
# Displaying the Chart | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment