Skip to content

Instantly share code, notes, and snippets.

@Priyanku-AI
Created November 28, 2023 10:01
Show Gist options
  • Save Priyanku-AI/223fd6821433c3ecc07fc3969b3b4624 to your computer and use it in GitHub Desktop.
Save Priyanku-AI/223fd6821433c3ecc07fc3969b3b4624 to your computer and use it in GitHub Desktop.
How to create line charts?
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