1

I want to mark specific dates on a plot just like in this other post. I already tried implementing it on my own but to no success. I know the dates beforehand so that I don`t need an algorithm to calculate and point out something for me, I just want dates I already have to be marked on the plot.

plt.figure()
plt.title(station\[k\]+' phase')
plt.plot(time_vector_datetime, phase1, '--',label='CW1')
plt.plot(time_vector_datetime, phase2, '-.',label='CW2')
plt.grid()
plt.xlabel('Time ')
plt.ylabel('Phase   \[rad\]')
plt.legend()
plt.gca().xaxis.set_major_formatter(myFmt)
plt.annotate('Max: {:.2f}\\nMin: {:.2f}'.format(phase1_max, phase1_min), xy=(0.05, 0.95), xycoords='axes fraction', ha='left', va='top')
plt.axhline(y=phase1_max, color='r', linestyle='--', linewidth=0.5)
plt.axhline(y=phase1_min, color='r', linestyle='--', linewidth=0.5)
plt.plot(time_vector_datetime\[1:\], np.diff(phase1), color='g', linewidth=0.5)

This is what I assume is creating the graph (I am extremely new to python).

This is the output (the code is only a snippet, which is why I was still able to generate something).

jared
  • 4,165
  • 1
  • 8
  • 31
Minetendo
  • 11
  • 2

0 Answers0