I am new to python. I am plotting the Bit error rate data w.r.t time and i want to remove these zeros. My x-axis values are like this hh:mm:ss:ffffff. I want to remove the seconds and microseconds as, it is occupying a lot of place on the graph/plot and they are overlapping on each other. How can i remove the seconds and microseconds (ss::ffffff) from x ticks? and plot only hours and minutes and remove the seconds and microseconds. Is it possible?
Asked
Active
Viewed 413 times
1 Answers
1
You can do this using the MinuteLocator
tick locator and a custom formatter (see also this answer)
import matplotlib.dates as mdates
ax.xaxis.set_major_locator(mdates.MinuteLocator())
ax.xaxis.set_major_formatter(mdates.DateFormatter('%H:%M'))
-
thank you very much.. it worked.. all i need is ax.xaxis.set_major_formatter(mdates.DateFormatter('%H:%M')) – Goutham Sai Siddardha Sep 01 '15 at 13:23