I have a plot that has on x axis time and on y axis values in percentages. The plot is drawn based on a dataframe output. As I would need to review many plots, would be good to insert some pointers of a different color. For example, each graph starts the timeline from 08:00 and finishes at 20:00. I would need a red marker at 12:00.
I have tried the following:
graph_df is a df that contains two columns: one with time and one with percentage data.
df = graph_df.loc[graph_df['time'] == "12:00"]
graph_df.plot(x="time", y="percentage", linewidth=1, kind='line')
plt.plot(df['time'], df['percentage'], 'o-', color='red')
plt.show()
plt.savefig(graph_name)
If I am using this section of the code, I am getting the marker at the correct percentage for 12:00, but always at the start of the timeline. In my case, the red dot is marked at 08:00, but with the right percentage associated.
Any idea why it's not correctly marked?
Thank you.