gganimate icon indicating copy to clipboard operation
gganimate copied to clipboard

geom_point not displayed in order

Open dgraetz opened this issue 2 years ago • 0 comments

I am following up on this stackoverflow post with a bug report. I have a data frame with variables from_axp for the x position, from_ayp for the y position and seq for the sequence order (the data frame is in correct order, though). I want to run the following code

(ggplot(test, aes(x = from_axp, y = from_ayp))+
  geom_path()+
  geom_point(aes(group = seq))+
  geom_text(aes(group = seq, label = seq), size = 4, position = position_nudge(x = 15))+
  transition_reveal(along = seq)) %>%
  animate(nframes = 422, fps = 2)

For instance, geom_point for seq = 9 is revealed only some time after point 80. This only happens in version 1.0.8 (gif @2FPS), not in version 1.0.7 (gif @4FPS). Another difference is that in 1.0.7, the end of the line also has a point and the corresponding number, whereas the point and number shows up in the next frame in 1.0.8 (see imgurs above).

Here is test data:

test <- structure(list(from_axp = c(156.3, 140.2, 149, 103.3, 74.8, 164.5, 
186.8, 243.2, 280.3, 130.9, 81, 77.9, 75.2, 152.1, 125.8, 224.6, 
290.1, 310, 307.4, 354.8, 424.5, 378.2, 449.3, 474.2, 444.8, 
421.9, 336.7, 315.7, 452.3, 574.1, 697.3, 581.6, 273.5, 312.7, 
181.7, 714.1, 655.9, 709.3, 843.4, 818.9, 731.9, 706.1, 626.4, 
659.9, 578.4, 725.1, 829.3, 812.9, 834.3, 864.6, 823.9, 844.7, 
916.4, 988.6, 1072.2, 1114.7, 1115.6, 1132.1, 1040, 1007.8, 1102.1, 
1134.4, 1128.7, 1073.1, 1114.2, 1088.6, 1220.5, 1259.9, 1263.5, 
1314.4, 1316.2, 1239.5, 1226.8, 1150, 1080, 1275.2, 1258.4, 1267.7, 
1276.9, 1302.7, 1333.5, 1251.1, 1258.6, 1257.8, 1272.2, 1310.6, 
1411.9, 1466.3, 1397.5, 1327.6, 1340.7, 1443.8, 1495.8, 1328.1, 
1276.2, 1303.6, 1225.7, 1277.5, 1130.6, 1137.4, 1308.9, 1308.8, 
1442.5, 1387.7, 1417.3, 1448.4, 1557.2, 1638.8, 1702.8, 1673.9, 
1731.3, 1731.8, 1715.2, 1697.7, 1717.1, 1714, 1728.8, 1788.4, 
1746.6, 1704.6, 1684.1, 1603.2, 1670, 1658.3, 1715.8, 1798.6, 
1721.6, 1746.3, 1728.4, 1699.1, 1670.7, 1703, 1783.1, 1818.2, 
1780.4, 1717.2, 1652.8, 1530.1, 1558.5, 1590.3, 1492.9, 1449.8, 
1562.5, 1455.2, 1437.3, 1331.6, 1394.2, 1289.4, 1138.4, 1022.4, 
1045.7, 1083.5, 1137.5, 1188.7, 1202.7, 1290.2, 1108.9, 1027.5, 
1133.5, 984.4, 1013.7, 976.6, 987.5, 998.2, 918.2, 1054.9, 1128.9, 
1004, 1015, 986.3, 1047.1, 1077.6, 886.8, 906.3, 837.6, 794, 
755.7, 852.4, 833.1, 780.3, 686.3, 594, 765.7, 815.4, 892.2, 
562.8, 533.2, 370.7, 398, 427.7, 449, 657.1, 601.2, 567.8, 613.3, 
592.7, 565.5, 544.6, 646.5, 681.6, 659.5, 566.2, 544.1, 593.8, 
666.3, 583.9, 544.1, 447.6, 447.1, 379.8, 359.8, 400, 352.8, 
390.6, 370.4, 442.2, 391.1, 146.9, 219.3, 244.1, 171.6, 175.3, 
114.5, 231.8, 225.4, 171.5, 168.4, 139.3, 386, 338.1, 435.3, 
114, 94.7, 166.1, 233.5, 238.3, 168, 144.5, 229.9, 182.9, 149.1, 
207.9, 113.8, 264.1, 258.7, 281.7, 248.6, 168, 179.2, 268.6, 
197.8, 232.5, 243, 258.2, 306.8, 143.5, 350.3, 384.1, 279.7, 
349.1, 374.6, 446.8, 437.6, 505.4, 600, 521.5, 521.9, 588.6, 
631.8, 672.1, 571.6, 589.3, 764.1, 795.9, 826.6, 835.1, 839.9, 
877.1, 874, 806.8, 815.8, 883.6, 936.1, 995, 1012.6, 1142.2, 
1028.9, 1102.7, 1085.9, 1133.8, 1124.3, 1129.2, 1164, 1141.6, 
1240, 1285.6, 1241, 1240.9, 1378.2, 1426.3, 1404.5, 1277.7, 1396.6, 
1397.3, 1403.4, 1473.2, 1498.2, 1447, 1473.8, 1643, 1668.5, 1669.8, 
1670.6, 1622.9, 1677.6, 1754.3, 1712.1, 1738.6, 1681.8, 1437.2, 
1407.6, 1393.8, 1617.5, 1666.1, 1786.2, 1745.3, 1380.1, 1384.2, 
1485.8, 1559.2, 1615.7, 1505.2, 1548.8, 1426.4, 1373.1, 1401, 
1736.1, 1755, 1668.9, 1652.2, 1421.9, 1403.4, 1109.5, 1181.7, 
1194.5, 1078.4, 800.9, 840.4, 840.9, 594.1, 625.6, 852.5, 512.5, 
520.8, 237.1, 311.6, 163.4, 122.9, 130.2, 148.9, 122.4, 97.1, 
103.9, 323, 390.7, 453.9, 663.4, 689.8, 312.1, 366.9, 506.7, 
132.7, 601.7, 566.9, 552.8, 521.7, 827.1, 814.3, 928.8, 895.2, 
1101.4, 1207.9, 1092.1, 1520.3, 1503.8, 1430.5, 1489.5, 1759.5, 
1738.1, 1624.9, 1562.6, 1441.8, 1432.6, 1460.4, 1439.9, 1369.9, 
1076.9, 1148.7, 1028.5, 1448.3, 1403.1, 1667, 1729.3, 1753.9, 
1610.1, 1617.7, 1758.3, 1292.4, 1378.3, 1392.7, 1147.1, 1461.7, 
1420.9, 1625.6, 1663.3, 1699.7, 1744.9, 1719.9, 1685.5, 1717.4, 
1627.9, 1718.1), from_ayp = c(518.5, 538.5, 501.2, 461.8, 402.8, 
509.2, 494.3, 531.5, 476.9, 517.4, 520.5, 408.3, 389, 344.2, 
342.3, 402.4, 413.9, 467.3, 435.6, 483.2, 521.2, 520.2, 490.4, 
456.3, 384.8, 355.2, 426.9, 467, 405.2, 466.7, 531.9, 666.7, 
734.9, 731.2, 720.8, 488.5, 541.9, 539.2, 496.3, 491.1, 544.8, 
527.9, 429.3, 427.9, 353.1, 348.4, 449.6, 490.9, 500.1, 534.5, 
409.2, 345.6, 324.6, 483.3, 523.8, 532.9, 379.6, 380.7, 290.4, 
260.1, 407, 392, 416.5, 451.1, 404.9, 418.7, 455.1, 526.9, 569.7, 
405.5, 415.9, 544.4, 593.8, 617.4, 616.2, 608.4, 470.4, 502.7, 
448.5, 398.2, 422.3, 544, 571.6, 356.8, 372.2, 394.7, 499.2, 
527.2, 392.6, 379.5, 424.4, 432.9, 417.7, 402.3, 420.1, 399.7, 
397.8, 428, 424.6, 379.8, 423.1, 399.9, 506.7, 454.9, 422.1, 
393.4, 442.4, 442.2, 361.3, 504.4, 508.5, 441.8, 453.2, 483.8, 
482, 403.6, 367.7, 402.5, 377.4, 389.5, 479.7, 428.8, 238.2, 
201.6, 151.9, 82.2, 23.3, 20.5999999999999, 207, 238.8, 243, 
272.4, 265.3, 99.2, 134.6, 150.8, 103.6, 159.4, 83.8, 49.8, 262, 
259.1, 260.4, 92.8, 50.8, 106.6, 57.3, 183, 235.9, 273.7, 170.4, 
158.2, 108.1, 92.7, 261.7, 185.8, 274.2, 278.7, 280, 288.9, 292.6, 
347.5, 287.1, 427.4, 425.3, 327.7, 406.6, 279, 283.3, 151.1, 
164.8, 148.6, 321.7, 302.5, 175.5, 119.4, 125.7, 285, 280.9, 
281.8, 190.3, 154.8, 118.5, 101.1, 121.4, 190.4, 266.7, 227.8, 
206.7, 140.2, 113.7, 265.8, 261.4, 309.7, 273.8, 209.6, 185.2, 
119.1, 119.9, 214.3, 194.4, 202.5, 165.3, 157.9, 123.2, 107, 
111.6, 185.2, 138.5, 324.7, 271.9, 286, 249.3, 210, 111.7, 143.7, 
265.9, 313.9, 307.1, 305, 207.9, 365.2, 426.8, 401.7, 475.8, 
228.3, 172, 111.7, 387, 475.5, 530.3, 444.9, 415.7, 246.6, 257.8, 
298.2, 320.1, 307.5, 147, 170.2, 507.8, 368.6, 400.3, 500, 548.2, 
471.1, 684.7, 722.4, 605.6, 614, 676.7, 665.3, 700.9, 755.1, 
757.7, 728.4, 765.2, 761.6, 747.8, 644.7, 586, 567.2, 579.7, 
678.9, 677.6, 778.5, 658.3, 652.5, 595.8, 761.6, 765, 691.4, 
847.8, 785.7, 808.6, 764.1, 788.2, 766, 673.9, 549.4, 573.2, 
583.6, 667.6, 726.2, 678.9, 785.2, 745.2, 619.8, 632.7, 647.3, 
621.8, 583.4, 577.1, 637.2, 654.4, 630, 566.7, 712.4, 719.4, 
714.1, 717.9, 573.8, 704.6, 709.1, 597.9, 715.4, 727.9, 604.9, 
573.7, 762.7, 751.7, 751.9, 561.2, 575.2, 563.5, 580.1, 711.4, 
712.3, 753.6, 684.3, 680.6, 697.6, 676.8, 670.3, 891.5, 881.6, 
701.9, 716.2, 876.2, 906, 909.3, 894.2, 911.2, 866.3, 930.2, 
936.7, 884.4, 887.1, 669.3, 733.7, 710, 718.4, 811, 819.7, 852.4, 
942.8, 815.5, 830.8, 841.6, 868.8, 895.6, 765.2, 733, 764.4, 
726, 745.1, 852.7, 846.6, 909.1, 916.4, 914.5, 800.8, 820.8, 
956.8, 978.2, 995.5, 1013.5, 1011.3, 979.8, 969.4, 937, 973.6, 
837.6, 857.4, 876.3, 883.3, 941.9, 963.5, 1008.5, 1021.2, 1004.9, 
1006.7, 1015.2, 991, 1002.4, 997.5, 1011.5, 860.2, 878.4, 926.9, 
918.1, 869.1, 897.1, 879.2, 817.1, 944.2, 889.8, 793.7, 703.4, 
711.6, 727.9, 861.8, 871.5, 895.6, 840.2, 910, 855.4, 650, 680.6, 
693.7, 772.5, 680.7, 673.9, 742, 726.6, 785.5, 864.3, 853.6, 
796.7, 867.4, 914.5, 893.2), seq = 1:422), row.names = c(NA, 
-422L), class = c("tbl_df", "tbl", "data.frame"))

dgraetz avatar Oct 11 '23 21:10 dgraetz