Different Data Plotting
1. Line Plot Purpose : A line plot shows the trend of a variable over time or ordered categories. When to use : Ideal for showing time-series data or any continuous variable where the trend is important. Description : The x-axis represents the time or sequential order, and the y-axis represents the value of the variable. Data points are connected by lines to show how the variable changes. Example : A plot showing the stock price of a company over several months. import matplotlib.pyplot as plt import numpy as np # Example Data months = ['Jan', 'Feb', 'Mar', 'Apr', 'May'] stock_price = [100, 120, 130, 125, 140] plt.plot(months, stock_price, marker='o') plt.title('Stock Price Over Time') plt.xlabel('Month') plt.ylabel('Stock Price') plt.show() Visualization : A line graph with months on the x-axis and stock price on the y-axis, showing the trend of stock prices. 2. Scatter Plot Purpose : A scatter plot displays th...