I have been trying to connect the markers in a line graph to get a better idea of the shape of a curve. The following is the code:
# Plot the data for each month in separate figures
for month in months:
month_data = monthly_data[monthly_data['month'] == month]
plt.figure(figsize=(40, 20))
plt.plot(month_data['datetime'], month_data['Transaction_Amount'], marker='o', linestyle='-')
plt.title(f'Transaction Amount - Month {month}')
plt.xlabel('Timestamp')
plt.ylabel('Transaction Amount')
plt.grid(True)
plt.show()
I tried adding a separate line which would use the markers as the connecting points but it didn’t work.
New contributor
Abhaydeep21 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.