How can I plot a 24 hour time series on the x-axis in ggplot2
<p>I realize there have been previous questions on how to plot time on the x-axis in ggplot2 but I have looked at those threads and still cannot fix my problem. I have a data set where I measured body temperature of a bird at the same times over several months. I have averaged the body temp at each time to get one 24 hour trace of body temperature. </p>

<p>I have converted my time vector to POSIXct using this code:</p>

<pre><code>rcnj.tb$Time=as.POSIXct(rcnj.tb$Time,format="%H:%M:%S",tz="Africa/Johannesburg")
</code></pre>

<p>I then plotted my figure using this code:</p>

<pre><code>ggplot(bird550,aes(Time,Tb)) + geom_line()
</code></pre>

<p>to get this figure.<a href="http://i.stack.imgur.com/A1gk8.png" rel="nofollow">Tb trace averaged across time</a></p>

<p>However, I do not want the date shown but just the time. The time shown is correct although I would like it on a different scale. So I tried this code to get rid of the date and change the scale</p>

<pre><code>last_plot()+scale_x_datetime(labels=date_format("%H:%M")),
                         breaks = date_breaks("2 hour"),
                         minor_breaks=date_breaks("1 hour"))
</code></pre>

<p>This resulted in this figure<a href="http://i.stack.imgur.com/e3jZc.png" rel="nofollow">Tb trace with date removed</a></p>

<p>However, the scale is wrong now because it should go from 00:00 to 00:00, like in the first graph. So, for my actual question, how can I remove the date component from my first graph to get an x-axis with just time starting at 00:00 and ending at 00:00.</p>

<p>It would appear that ggplot2 is shifting my scale by two hours so I've tried using different time zones because I saw one post mention that. I've also messed around with strftime. I'm wondering if it isn't a limits issue where I need to set a specific limit?</p>

<p>Thanks for any advice</p>