Formatting time on a plot in Python

时间:2015-05-12 22:13:36

标签: python datetime pandas matplotlib

I have the following code and was wondering how I could format the time to read in a 12 hr format. e.g. 0:00, 3:30, 10:00 etc. as of now the y axis reads 00:00:00, 00:01:00, 00:02:00 and so on. The data in the csv was formatted like this, 0:00, 1:00,2:00 etc.

How could I go about formatting the y axis to the format I need to?

Here is the code I have:

I/ControlNetSocketThread﹕ send timeout to ControlNetSocket(LoggingNetSocket(Socket2NetSocket(Socket[address=/82.94.251.203,port=80,localPort=43309]))): overall timeout reached

Here is an image of what the graph shows: enter image description here

1 个答案:

答案 0 :(得分:3)

Use DateFormatter:

angular.module("myapp", ["ngAnimate"])

 .controller("showCrtl", function ($scope) {
    $scope.bottom = true;

    $scope.menu = function () {
        if ($scope.bottom) {
            $scope.bottom = false;
        } else {
            $scope.bottom = true;
        }
    };
});