[Python] How to setup the same scale for X axis (timestamp) in multiple graphs using matplotlib

Discussão em 'Python' iniciado por Stack, Maio 3, 2025.

  1. Stack

    Stack Membro Participativo

    I am using Python and Matplotlib to try to generate the following: four charts plotting the amount of messages received in a system VS the delay in processing these messages, in a given period of time, in intervals of 5 minutes.

    That is, the X axis shows time from moment A to moment B (in the format "%Y-%m-%d %H:%M") in intervals of five minutes, while the left Y axis shows the amount of messages received at any given moment, and the right Y axis shows the delays in processing these messages.

    Now, I got to plotting both X axes in the chart, but I need the timestamps to be the same for every graph, that is, all must start and end at the same point in time, even if there are no events in those times for some of the charts (e.g., chart#1 starts at 15:50 of the 10/5/2015 and stopped at 14:00 11/5/2015, even if in one of them the events start happening at 17:00 of 10/5). And that's the killer.

    How can I do this?

    Continue reading...

Compartilhe esta Página