[Edited to clarify that X is a 2×2, part of a meshgrid.]
Assume the data for the x-axis is duration in seconds, in both directions, with values ranging from -10800 to +-10800 seconds.
I use a contourf(X,Y,Z) to plot it.
In the x-axis, instead of:
-10800, -9000, … , 9000, 10800
I would like to show the following ticks:
-03:00, -02:30, … , +02:30, +03:00
That is:
- Change seconds duration to hh:mm
- Keep negative sign in front of the negative durations
- Add the plus sign to the positive values (I could do this via xtickformat('%+4.4g');, but I am not able to combine this with the hh:mm format)
I have been playing around with xtickformat and datetick, but had no success so far.
Thank you!
Best Answer