title: Convert X-axis from date to hrs in ggplot2
body: <p>I have a recording during 48 h of a probe of pressure of a recipient. After importing data from Excel I get two vars Time (class= &quot;POSIXct&quot; and Probe ('numeric').</p>
  <pre><code>'data.frame':   3647 obs. of  2 variables:
  $ Date : POSIXct, format: &quot;2020-01-15 17:34:02&quot; &quot;2020-01-15 17:34:42&quot;...
  $ probe: num  31.6 35.8 29.9 29.1 30.1...
  </code></pre>
  <p>I plot both vars using ggplot2 and geom_line and I get this graph
  <img src="https://i.stack.imgur.com/lqF0s.png" alt="Figure" /></p>
  <p>The X axis shows time (total 48 h)
  However, when I try to format time by using:</p>
  <pre><code>library(hms) 
  data$time&lt;-as_hms(data$Date)
  </code></pre>
  <p>I got a  messy plot. I have tried different methods to convert 'data$time' to a different scales but I cannot manage this.
  Any help would be appreciated</p>