Animate line graph with view_zoom_manual, Limittations?

Hello,
I am new to RStudio.
I am tring to animate a long stream of simple Data (one Value per point in time) where the x-Axis is sliding as the values "appears".

I thaught that view_zoom_manual would be the way to go.
My problem can be reproduced with the following example.
As long as the intervalls for xmin and xmax are smal the x axis slide correct . But when the intervalls are bigger then the x- axis doesn't slide the whole way. E.g. when using " xmin = 0:79, xmax = 20:99" the viewer restarts the animation before the x-Axis even reaches 70.

Is there any undocumented limitations for the zoom function?
Or am i doing something wrong?

With best regards
Tilo

'''' r
library(ggplot2)
library(gganimate)

Step <- c(1:500)
Value <- runif(50,0,10)
Final <- data.frame(Step, Value)
a <- ggplot(Final, aes(x = Step, y = Value)) +
geom_line(size = 1) +
geom_point() +
view_zoom_manual(
#OK
#xmin = 0:20, xmax = 20:40, ymin = min(Final$Value), ymax = max(Final$Value)
#xmin = 0:40, xmax = 20:60, ymin = min(Final$Value), ymax = max(Final$Value)
#xmin = 20:40, xmax = 40:60, ymin = min(Final$Value), ymax = max(Final$Value)
#xmin = 120:140, xmax = 140:160, ymin = min(Final$Value), ymax = max(Final$Value)
#xmin = 200:240, xmax = 220:260, ymin = min(Final$Value), ymax = max(Final$Value)
#xmin = 200:240, xmax = 260:300, ymin = min(Final$Value), ymax = max(Final$Value)

#not OK
xmin = 0:79, xmax = 20:99, ymin = min(Final$Value), ymax = max(Final$Value)
#xmin = 1:200, xmax = 21:220, ymin = min(Final$Value), ymax = max(Final$Value)
#xmin = 120:240, xmax = 140:260, ymin = min(Final$Value), ymax = max(Final$Value)

)

animate(a)
'''''

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.