# Get this figure: fig <- get_figure("cimar", 38) # Get this figure's data: data <- get_figure("cimar", 38)$data # Add data to this figure: p <- add_trace(p, x=c(4, 5), y=c(4, 5), kwargs=list(filename="Mothers Day FB Distance", fileopt="extend")) # Get y data of first trace: y1 <- get_figure("cimar", 38)$data[[1]]$y # Get figure documentation: https://plotly.com/r/get-requests/ # Add data documentation: https://plotly.com/r/file-options/ # You can reproduce this figure in R with the following code! # Learn about API authentication here: https://plotly.com/r/getting-started # Find your api_key here: https://plotly.com/settings/api library(plotly) trace1 <- list( x = c("12.973760932944607", "13.965014577259478", "15.014577259475221", "15.947521865889213", "16.96793002915452", "17.988338192419825", "18.93377759266972", "19.97084548104956", "21.020408163265305", "21.9533527696793", "22.973760932944604", "23.994169096209912", "24.927113702623906", "25.97667638483965", "26.997084548104958", "27.959183673469383", "28.950437317784257", "29.999999999999996", "30.93294460641399", "31.982507288629737", "32.97376093294461", "33.965014577259474", "34.95626822157435", "36.005830903790084", "36.93877551020408", "37.98833819241982", "38.97959183673469", "39.91253644314868", "40.96209912536443", "42.011661807580175", "42.944606413994165", "43.96501457725947", "44.981257809246145", "45.918367346938766", "46.967930029154516", "48.00499791753436", "48.950437317784264", "49.94169096209912", "50.99125364431487", "51.92419825072885", "52.9737609329446", "53.96501457725947", "54.9271137026239", "55.94752186588921", "56.997084548104944", "57.93002915451895", "58.97959183673469", "59.97084548104955"), y = c("203.9885083093312", "235.96550146359203", "251.84503522593286", "257.5653630236228", "229.05901883604832", "229.16434466859465", "255.83878112490018", "283.0579688040781", "289.4304603128978", "293.39022473030604", "290.47744191094085", "321.4278381660224", "344.60289433393365", "357.91703574214966", "369.853347490189", "374.63762164825687", "383.22427275020385", "385.2205067137519", "386.46397334443986", "388.9632254166398", "384.37080207190667", "393.8125839585619", "397.72116665004603", "394.93872858140094", "399.70332197265225", "398.58084366255844", "397.86165975444504", "397.29426119398613", "397.93234626417393", "394.84809733033774", "405.4980025928163", "410.7039320470931", "410.7489585576768", "415.1110746109309", "415.2461415724669", "421.11580352586157", "422.96270333370484", "427.5252095664365", "430.678385179884", "433.3806043256624", "441.9160737016853", "448.13853969296827", "448.92885006834007", "457.6659666453532", "466.6038505082976", "472.3744801168527", "492.47936599186966", "499.25515190266964"), uid = "4f4833", line = lis), mode = "markers", name = "Distance to Child", type = "scatter", xsrc = "cimar:562:34d47a", ysrc = "cimar:562:28eeae", marker = list( line = list( color = "rgb(217, 217, 217)", width = 0.5 ), size = 8, color = "rgb(100, 181, 255)" ), error_x = lis), error_y = lis), textfont = lis) ) trace2 <- list( x = c(12.973760932944607, 13.932885107395728, 14.89200928184685, 15.851133456297973, 16.810257630749096, 17.76938180520021, 18.728505979651334, 19.687630154102457, 20.646754328553577, 21.6058785030047, 22.56500267745582, 23.524126851906942, 24.483251026358065, 25.44237520080918, 26.401499375260304, 27.360623549711427, 28.319747724162546, 29.27887189861367, 30.237996073064792, 31.19712024751591, 32.15624442196703, 33.11536859641816, 34.07449277086928, 35.03361694532039, 35.99274111977152, 36.95186529422264, 37.91098946867376, 38.87011364312488, 39.829237817576, 40.78836199202713, 41.74748616647825, 42.706610340929366, 43.665734515380485, 44.62485868983161, 45.58398286428273, 46.54310703873386, 47.50223121318498, 48.4613553876361, 49.420479562087216, 50.37960373653834, 51.33872791098946, 52.29785208544059, 53.256976259891694, 54.21610043434282, 55.17522460879394, 56.134348783245066, 57.093472957696186, 58.052597132147305, 59.01172130659843, 59.97084548104955), y = c(228.97829843708988, 225.12007475580467, 226.06669193959874, 230.8162761109588, 238.48951494772118, 248.32069236069202, 259.649037359421, 271.9103871061353, 284.6291641578318, 297.4106678965334, 309.9336801476825, 321.94338498673534, 333.24460273386035, 343.69533813685, 353.2006427421489, 361.70679145405313, 369.19577328209687, 375.6800962765408, 381.1979066520662, 385.8084220996284, 389.5876792864226, 392.6245955440512, 395.01734474484715, 396.87004736632866, 398.2897747438619, 399.3838675113998, 400.25756823046936, 401.0119682072793, 401.7422684979574, 402.53635510199547, 403.47368834383315, 404.6245064425839, 406.0493432699518, 407.7988602962869, 409.9139927248025, 412.42640981390286, 415.35928938782763, 418.7284065352396, 422.5435364961277, 426.81017173680266, 431.5315532130935, 436.7110158216219, 442.3546480392815, 448.4742657510433, 455.0907002655167, 462.237400519105, 469.9643494679949, 478.34229466850957, 487.4672930455854, 497.465569849257), fit = list( rms = 10.225158418837305, uid = "805005", corr = 0.9918042315127685, params = list( list( err = 514.8698355389339, hold = FALSE, name = "a", value = 1593.3437819687083 ), list( err = 106.14527946004448, hold = FALSE, name = "b", value = -281.37022784661957 ), list( err = 8.636821869828283, hold = FALSE, name = "c", value = 21.513114164878147 ), list( err = 0.35648424163248676, hold = FALSE, name = "d", value = -0.7812928003912942 ), list( err = 0.007908616362106491, hold = FALSE, name = "e", value = 0.014870575593640743 ), list( err = 8.983056720162337e-05, hold = FALSE, name = "f", value = -0.00014374566194034471 ), list( err = 4.0990574150125277e-07, hold = FALSE, name = "g", value = 5.605421722382666e-07 ) ), parent = c("4f4833"), fitname = "Col2 - fit", funcStr = "a + b*x + c*x^2 + d*x^3 + e*x^4 + f*x^5 + g*x^6", ninterp = "50", iterations = 1, inputxrange = c("", ""), outputxrange = c("", "") ), uid = "805005", line = list( dash = "solid", color = "rgba(28, 69, 135, 0.6)", width = 2 ), name = "y = 1593 - 281.4*x + 21.51*x^2 - .7813*x^3 + .01487*x^4 - .0001437*x^5 + .0000005606*x^6", type = "scatter", xsrc = "cimar:562:fc69bd", ysrc = "cimar:562:80e1b9", xaxis = "x", yaxis = "y", marker = list(line = lis)), error_x = lis), error_y = lis), opacity = 0.8, textfont = lis) ) trace3 <- list( x = c(13.1301721550467, 13.664172598119, 14.1332065370526, 14.4157340708344, 14.771966621883, 15.2465661892919, 15.6817811508446, 16.10018743798, 16.59154089129, 16.9871526884486, 17.3828359488894, 17.8574236057513, 18.281022210788, 18.6488079924534, 19.0048880885001, 19.4401387816939, 19.9147621701969, 20.3497770345596, 20.74571220307, 21.1412614698567, 21.5763549438298, 22.0510319297944, 22.5255123917331, 22.9999213903896, 23.4350613154961, 23.8704334962696, 24.3448603607466, 24.7532908841437, 25.0965826258468, 25.4916387959866, 25.9096530559741, 26.4010019152159, 26.7415115913443, 27.1919932538661, 27.6943443958494, 28.1208863948203, 28.6154703713232, 29.0896292484921, 29.5582956619745, 30.1566385815967, 30.590947746048, 31.0650530257553, 31.5388545865134, 31.9335820255552, 32.4865113054912, 32.9601163422233, 33.4336856473144, 33.9074157447903, 34.3733599176742, 34.8549116713832, 35.3284095131921, 35.8020145499242, 36.2758339765028, 36.7495283423377, 37.2231155132493, 37.6964882943143, 38.1699325386616, 38.643448246291, 39.1168210273561, 39.5901938084212, 40.0635665894863, 40.5370108338335, 41.0105265414629, 41.484095846554, 41.957861675671, 42.4315917731469, 42.9051789440585, 43.3552439756453, 43.844674556213, 44.3025469513763, 44.799795615013, 45.2733827859245, 45.7470056884772, 46.220664322671, 46.6943586885058, 47.1680530543406, 47.641961810022, 48.1160134922676, 48.5898507846668, 49.0635630163222, 49.537489637824, 50.0114341251465, 50.48541434411, 50.9592337706886, 51.433178258011, 51.9072120744361, 52.3813054435964, 52.8553154389274, 53.3294028528142, 53.8037046565474, 54.2778813995369, 54.7521296058085, 55.2261634222336, 55.7006260183517, 56.1747848955206, 56.649158162536, 57.1235671611925, 57.5980118914901, 58.0891432981734, 58.4806906211588, 58.9026723694365, 59.3136309064402, 59.6546536889346, 59.9710037732612), y = c(219.870923913043, 225.407608695652, 230.337732919254, 233.220108695652, 237.794384057971, 242.459239130434, 247.364130434782, 252.639751552795, 256.72554347826, 261.039402173913, 265.625, 270.244565217391, 273.835403726708, 279.483695652173, 283.478260869565, 288.51902173913, 293.274456521739, 297.418478260869, 302.961956521739, 307.03804347826, 311.480978260869, 316.440217391304, 320.652173913043, 324.592391304347, 329.211956521739, 334.714673913043, 338.722826086956, 341.779891304347, 347.146739130434, 349.347826086956, 353.132763975155, 357.201086956521, 361.989130434782, 364.945652173913, 367.99301242236, 372.061820652173, 377.717391304347, 380.70652173913, 384.239130434782, 388.009510869565, 389.470108695652, 392.255434782608, 393.885869565217, 394.836956521739, 397.35054347826, 398.233695652173, 398.980978260869, 400.339673913043, 402.092391304347, 403.192934782608, 403.668478260869, 404.551630434782, 406.25, 407.472826086956, 408.28804347826, 408.28804347826, 408.559782608695, 409.103260869565, 409.103260869565, 409.103260869565, 409.103260869565, 409.375, 409.918478260869, 410.665760869565, 412.160326086956, 413.51902173913, 414.334239130434, 415.70652173913, 416.766304347826, 417.826086956521, 418.614130434782, 419.429347826087, 420.380434782608, 421.467391304347, 422.690217391304, 423.91304347826, 425.951086956521, 428.532608695652, 430.298913043478, 431.589673913043, 433.695652173913, 435.869565217391, 438.179347826087, 439.877717391304, 442.051630434782, 444.565217391304, 447.305253623188, 449.728260869565, 452.445652173913, 455.978260869565, 459.035326086956, 462.364130434782, 464.877717391304, 469.021739130434, 472.010869565217, 475.815217391304, 479.755434782608, 483.83152173913, 487.072981366459, 490.217391304347, 494.802989130434, 497.472826086956, 504.211956521739, 507.133152173913), uid = "3eda14", fill = "none", line = list( color = "rgb(67, 67, 67)", width = 0.5 ), mode = "none", name = "Error Bound (Upper)", type = "scatter", xsrc = "cimar:562:1a8a1e", ysrc = "cimar:562:534c1f", marker = list(line = lis)), error_x = lis), error_y = lis), opacity = 1, visible = FALSE, textfont = lis) ) trace4 <- list( x = c(13.102596261041, 13.4986011062516, 13.8549223908755, 14.1982891690249, 14.5227835152584, 14.9796115255981, 15.2806791870337, 15.636979032673, 15.9933539147585, 16.3495840836977, 16.7454013377926, 17.1807949575508, 17.5370090472515, 17.9328531000771, 18.4075300860417, 18.8430880713489, 19.2388946059514, 19.6740738358631, 20.1561830031729, 20.3074171740559, 20.7425392333419, 21.1871569762456, 21.6520345596432, 22.1267115456078, 22.6011562759054, 23.0756903353057, 23.5502065288854, 23.9849355401194, 24.4992389160449, 24.960766658091, 25.4484499614098, 25.9228589600663, 26.3578166538032, 26.7928886887916, 27.2673691507303, 27.7417066861046, 28.2160978189406, 28.6903996226738, 29.1645942314838, 29.6388067061143, 30.1130370465654, 30.5869636680673, 31.0608366921075, 31.5347990452505, 32.0086899351113, 32.4825808249721, 32.8375568133093, 33.429844495898, 33.9034495326301, 34.3771438984649, 34.8507310693765, 35.3243361061086, 35.7981019352256, 36.2717248377783, 36.7452584112283, 37.2187562530371, 37.6923970214104, 38.1658412657576, 38.6392676442843, 39.1127833519137, 39.586227596261, 40.0674899236772, 40.5329731583912, 41.0063459394563, 41.5035588714518, 41.9924588371494, 42.4270359889089, 42.9009983420518, 43.3747820369893, 43.8485478661064, 44.3221171711974, 44.7958294028528, 45.2694523054054, 45.743236000343, 46.2169125003573, 46.6906604636537, 47.1644977560529, 47.6383171826315, 48.1122080724923, 48.5861882914558, 49.0601685104193, 49.5340653555536, 50.0078430952176, 50.481984106566, 50.9559107280679, 51.4298671259373, 51.8643126661521, 52.4569969699568, 52.9308610610868, 53.4051271331789, 53.8791341508732, 54.3530071749135, 54.7479043392504, 55.4592945144784, 55.8935983191836, 56.4067189777892, 56.7235871709115, 57.1976924506188, 57.6716905354029, 58.1458494125718, 58.6198832289969, 59.0938634479604, 59.5679329960266, 59.9237486779292), y = c(190.013586956521, 195.822010869565, 200.733695652173, 206.385869565217, 211.704192546583, 217.364130434782, 222.173913043478, 227.004076086956, 232.119565217391, 236.684782608695, 241.779891304347, 247.364130434782, 251.868206521739, 257.065217391304, 262.024456521739, 268.233695652173, 273.28804347826, 278.057065217391, 281.277173913043, 286.345108695652, 290.896739130434, 294.055706521739, 299.252717391304, 304.211956521739, 308.28804347826, 312.703804347826, 317.051630434782, 320.108695652173, 325.747282608695, 330.70652173913, 335.122282608695, 339.0625, 342.989130434782, 347.35054347826, 351.5625, 355.230978260869, 359.103260869565, 362.635869565217, 365.760869565217, 368.953804347826, 372.214673913043, 374.320652173913, 376.222826086956, 378.464673913043, 380.434782608695, 382.404891304347, 382.201086956521, 384.375, 385.258152173913, 386.480978260869, 387.296195652173, 388.179347826087, 389.673913043478, 390.625, 391.236413043478, 391.711956521739, 392.730978260869, 393.002717391304, 393.20652173913, 393.75, 394.021739130434, 394.021739130434, 394.021739130434, 394.021739130434, 394.673913043478, 393.716032608695, 396.195652173913, 398.4375, 400, 401.494565217391, 402.241847826087, 403.532608695652, 404.483695652174, 406.046195652173, 407.201086956521, 408.627717391304, 410.39402173913, 412.092391304347, 414.0625, 416.372282608695, 418.682065217391, 420.674818840579, 422.214673913043, 425.135869565217, 427.241847826086, 429.461050724637, 431.440217391304, 435.122282608695, 436.990489130434, 440.387228260869, 442.798913043478, 444.701086956521, 446.297554347826, 451.358695652173, 452.798913043478, 453.940217391304, 458.83152173913, 461.616847826087, 463.994565217391, 466.983695652173, 469.497282608695, 471.807065217391, 474.45652173913, 477.445652173913), uid = "6bc1a0", fill = "tonextx", line = list( color = "rgb(67, 67, 67)", width = 0.5 ), mode = "none", name = "Error Bound (Lower)", type = "scatter", xsrc = "cimar:562:10d247", ysrc = "cimar:562:e4ba7f", marker = list(line = lis)), error_x = lis), error_y = lis), visible = FALSE, textfont = lis), fillcolor = "rgb(217, 217, 217)" ) trace5 <- list( x = c(""), y = c(""), uid = "ceccb0", line = lis), name = "trace 4", type = "scatter", xsrc = "cimar:562:96f2d2", ysrc = "cimar:562:96f2d2", marker = list(line = lis)), error_x = lis), error_y = lis), visible = FALSE, textfont = lis) ) trace6 <- list( x = c(""), y = c(""), uid = "154678", line = lis), name = "trace 5", type = "scatter", xsrc = "cimar:562:96f2d2", ysrc = "cimar:562:96f2d2", marker = list(line = lis)), error_x = lis), error_y = lis), visible = FALSE, textfont = lis) ) trace7 <- list( x = c(""), y = c(""), uid = "8db1da", line = lis), name = "trace 6", type = "scatter", xsrc = "cimar:562:96f2d2", ysrc = "cimar:562:96f2d2", marker = list(line = lis)), error_x = lis), error_y = lis), visible = FALSE, textfont = lis) ) trace8 <- list( x = c(""), y = c(""), uid = "beabb5", line = lis), name = "trace 7", type = "scatter", xsrc = "cimar:562:96f2d2", ysrc = "cimar:562:96f2d2", marker = list(line = lis)), error_x = lis), error_y = lis), visible = FALSE, textfont = lis) ) trace9 <- list( x = c(""), y = c(""), uid = "a5a133", line = lis), name = "trace 8", type = "scatter", xsrc = "cimar:562:96f2d2", ysrc = "cimar:562:96f2d2", marker = list(line = lis)), error_x = lis), error_y = lis), visible = FALSE, textfont = lis) ) trace10 <- list( x = c(""), y = c("1593"), uid = "12abb5", line = lis), name = "trace 9", type = "scatter", xsrc = "cimar:562:96f2d2", ysrc = "cimar:562:160972", marker = list(line = lis)), error_x = lis), error_y = lis), visible = FALSE, textfont = lis) ) trace11 <- list( x = c(""), y = c(""), uid = "95bbe7", line = lis), name = "trace 10", type = "scatter", xsrc = "cimar:562:96f2d2", ysrc = "cimar:562:96f2d2", marker = list(line = lis)), error_x = lis), error_y = lis), visible = FALSE, textfont = lis) ) trace12 <- list( x = c(""), y = c(""), uid = "409da1", line = lis), name = "trace 11", type = "scatter", xsrc = "cimar:562:96f2d2", ysrc = "cimar:562:96f2d2", marker = list(line = lis)), error_x = lis), error_y = lis), visible = FALSE, textfont = lis) ) trace13 <- list( x = c(""), y = c(""), uid = "68fa1f", line = lis), name = "trace 12", type = "scatter", xsrc = "cimar:562:96f2d2", ysrc = "cimar:562:96f2d2", marker = list(line = lis)), error_x = lis), error_y = lis), visible = FALSE, textfont = lis) ) trace14 <- list( x = c(""), y = c(""), uid = "da094f", line = lis), name = "trace 13", type = "scatter", xsrc = "cimar:562:96f2d2", ysrc = "cimar:562:96f2d2", marker = list(line = lis)), error_x = lis), error_y = lis), visible = FALSE, textfont = lis) ) trace15 <- list( x = c(""), y = c(""), uid = "deb6f3", line = lis), name = "trace 14", type = "scatter", xsrc = "cimar:562:96f2d2", ysrc = "cimar:562:96f2d2", marker = list(line = lis)), error_x = lis), error_y = lis), visible = FALSE, textfont = lis) ) trace16 <- list( x = c(""), y = c(""), uid = "f96be1", line = lis), name = "trace 15", type = "scatter", xsrc = "cimar:562:96f2d2", ysrc = "cimar:562:96f2d2", marker = list(line = lis)), error_x = lis), error_y = lis), visible = FALSE, textfont = lis) ) trace17 <- list( x = c(""), y = c(""), uid = "c5ca15", line = lis), name = "trace 16", type = "scatter", xsrc = "cimar:562:96f2d2", ysrc = "cimar:562:96f2d2", marker = list(line = lis)), error_x = lis), error_y = lis), visible = FALSE, textfont = lis) ) trace18 <- list( x = c(""), y = c(""), uid = "dda0ec", line = lis), name = "trace 17", type = "scatter", xsrc = "cimar:562:96f2d2", ysrc = "cimar:562:96f2d2", marker = list(line = lis)), error_x = lis), error_y = lis), visible = FALSE, textfont = lis) ) trace19 <- list( x = c(""), y = c(""), uid = "6bfd9b", line = lis), name = "trace 18", type = "scatter", xsrc = "cimar:562:96f2d2", ysrc = "cimar:562:96f2d2", marker = list(line = lis)), error_x = lis), error_y = lis), visible = FALSE, textfont = lis) ) trace20 <- list( x = c(""), y = c(""), uid = "201749", line = lis), name = "trace 19", type = "scatter", xsrc = "cimar:562:96f2d2", ysrc = "cimar:562:96f2d2", marker = list(line = lis)), error_x = lis), error_y = lis), visible = FALSE, textfont = lis) ) trace21 <- list( x = c(""), y = c(""), uid = "7c8d5e", line = lis), name = "trace 20", type = "scatter", xsrc = "cimar:562:96f2d2", ysrc = "cimar:562:96f2d2", marker = list(line = lis)), error_x = lis), error_y = lis), visible = FALSE, textfont = lis) ) data <- list(trace1, trace2, trace3, trace4, trace5, trace6, trace7, trace8, trace9, trace10, trace11, trace12, trace13, trace14, trace15, trace16, trace17, trace18, trace19, trace20, trace21) layout <- list( font = list( size = 12, color = "#444", family = "'Open sans', verdana, arial, sans-serif" ), smith = FALSE, title = "
The Average Distance between Mother and Child over the Course of a Lifetime", width = 650, xaxis = list( type = "linear", dtick = 10, range = c(5, 65), tick0 = 0, ticks = "", title = "Child's Age", anchor = "y", domain = c(0, 1), mirror = FALSE, nticks = 0, ticklen = 5, autotick = TRUE, position = 0, showgrid = TRUE, showline = FALSE, tickfont = list( size = 0, color = "", family = "" ), zeroline = FALSE, autorange = FALSE, gridcolor = "rgb(255, 255, 255)", gridwidth = 1, linecolor = "#444", linewidth = 1, rangemode = "tozero", tickangle = "auto", tickcolor = "#444", tickwidth = 1, titlefont = list( size = 0, color = "", family = "" ), overlaying = FALSE, showexponent = "all", zerolinecolor = "#444", zerolinewidth = 1, exponentformat = "B", showticklabels = TRUE ), yaxis = list( type = "linear", dtick = 100, range = c(0.1, 600), tick0 = 0, ticks = "", title = "Mean Distance to Child [as declared on Facebook] (miles)", anchor = "x", domain = c(0, 1), mirror = FALSE, nticks = 0, ticklen = 5, autotick = TRUE, position = 0, showgrid = TRUE, showline = FALSE, tickfont = list( size = 0, color = "", family = "" ), zeroline = FALSE, autorange = FALSE, gridcolor = "rgb(255, 255, 255)", gridwidth = 1, linecolor = "#444", linewidth = 1, rangemode = "normal", tickangle = "auto", tickcolor = "#444", tickwidth = 1, titlefont = list( size = 0, color = "", family = "" ), overlaying = FALSE, showexponent = "all", zerolinecolor = "#444", zerolinewidth = 1, exponentformat = "B", showticklabels = TRUE ), bargap = 0.2, boxgap = 0.3, height = 650, legend = list( x = -0.005309734513274336, y = 0.10303030303030303, font = list( size = 0, color = "", family = "" ), bgcolor = "rgba(255, 255, 255, 0)", xanchor = "left", yanchor = "top", traceorder = "normal", bordercolor = "rgba(68, 68, 68, 0)", borderwidth = 0 ), margin = list( b = 80, l = 80, r = 80, t = 100, pad = 0, autoexpand = TRUE ), barmode = "group", boxmode = "overlay", autosize = FALSE, dragmode = "zoom", hovermode = "x", titlefont = list( size = 0, color = "", family = "" ), separators = ".,", showlegend = FALSE, annotations = list( list( x = 18.327433628318584, y = 270.96393939393937, ax = -38, ay = -193.75, tag = "", font = list( size = 0, color = "", family = "" ), text = "High School Graduation
(18 yo, 249 miles)", xref = "x", yref = "y", align = "right", bgcolor = "rgba(0,0,0,0)", opacity = 1, xanchor = "auto", yanchor = "auto", arrowhead = 1, arrowsize = 1, borderpad = 1, showarrow = TRUE, arrowcolor = "", arrowwidth = 0, bordercolor = "", borderwidth = 1 ), list( x = 28.097345132743364, y = 383.6724242424242, ax = -13, ay = -54.5, tag = "", font = list( size = 0, color = "", family = "" ), text = "Age at 1st Marriage -- U.S.
(28 yo, 363 miles)", xref = "x", yref = "y", align = "right", bgcolor = "rgba(0,0,0,0)", opacity = 1, xanchor = "auto", yanchor = "auto", arrowhead = 1, arrowsize = 1, borderpad = 1, showarrow = TRUE, arrowcolor = "", arrowwidth = 0, bordercolor = "", borderwidth = 1 ), list( x = 29.61007765938234, y = 10.130565226735413, ax = -10, ay = -28.5, tag = "", font = list( size = 0, color = "", family = "" ), text = "Line of Best Fit: R2 = .9837
y = 1593 - 28.1*x +21.51*x^2 - .7813*x^3
+ .01487*x^4 - .0001437*x^5 + .0000005605*x^6 ", xref = "x", yref = "y", align = "right", bgcolor = "rgba(0,0,0,0)", opacity = 1, xanchor = "auto", yanchor = "auto", arrowhead = 1, arrowsize = 1, borderpad = 1, showarrow = FALSE, arrowcolor = "rgb(102, 102, 102)", arrowwidth = 0, bordercolor = "", borderwidth = 1 ), list( x = 24.168141592920357, y = 287.93080808080805, ax = 75, ay = -2.5, tag = "", font = list( size = 0, color = "rgb(99, 99, 99)", family = "" ), text = "4 years of undergrad", xref = "x", yref = "y", align = "center", bgcolor = "rgba(0,0,0,0)", opacity = 1, xanchor = "auto", yanchor = "auto", arrowhead = 0, arrowsize = 1, borderpad = 1, showarrow = TRUE, arrowcolor = "rgb(151, 151, 151)", arrowwidth = 0, bordercolor = "", borderwidth = 1 ) ), bargroupgap = 0, boxgroupgap = 0.3, hidesources = FALSE, plot_bgcolor = "rgba(245, 247, 247, 0.8)", paper_bgcolor = "rgb(255, 255, 255)" ) p <- plot_ly() p <- add_trace(p, x=trace1$x, y=trace1$y, uid=trace1$uid, line=trace1$line, mode=trace1$mode, name=trace1$name, type=trace1$type, xsrc=trace1$xsrc, ysrc=trace1$ysrc, marker=trace1$marker, error_x=trace1$error_x, error_y=trace1$error_y, textfont=trace1$textfont) p <- add_trace(p, x=trace2$x, y=trace2$y, fit=trace2$fit, uid=trace2$uid, line=trace2$line, name=trace2$name, type=trace2$type, xsrc=trace2$xsrc, ysrc=trace2$ysrc, xaxis=trace2$xaxis, yaxis=trace2$yaxis, marker=trace2$marker, error_x=trace2$error_x, error_y=trace2$error_y, opacity=trace2$opacity, textfont=trace2$textfont) p <- add_trace(p, x=trace3$x, y=trace3$y, uid=trace3$uid, fill=trace3$fill, line=trace3$line, mode=trace3$mode, name=trace3$name, type=trace3$type, xsrc=trace3$xsrc, ysrc=trace3$ysrc, marker=trace3$marker, error_x=trace3$error_x, error_y=trace3$error_y, opacity=trace3$opacity, visible=trace3$visible, textfont=trace3$textfont) p <- add_trace(p, x=trace4$x, y=trace4$y, uid=trace4$uid, fill=trace4$fill, line=trace4$line, mode=trace4$mode, name=trace4$name, type=trace4$type, xsrc=trace4$xsrc, ysrc=trace4$ysrc, marker=trace4$marker, error_x=trace4$error_x, error_y=trace4$error_y, visible=trace4$visible, textfont=trace4$textfont, fillcolor=trace4$fillcolor) p <- add_trace(p, x=trace5$x, y=trace5$y, uid=trace5$uid, line=trace5$line, name=trace5$name, type=trace5$type, xsrc=trace5$xsrc, ysrc=trace5$ysrc, marker=trace5$marker, error_x=trace5$error_x, error_y=trace5$error_y, visible=trace5$visible, textfont=trace5$textfont) p <- add_trace(p, x=trace6$x, y=trace6$y, uid=trace6$uid, line=trace6$line, name=trace6$name, type=trace6$type, xsrc=trace6$xsrc, ysrc=trace6$ysrc, marker=trace6$marker, error_x=trace6$error_x, error_y=trace6$error_y, visible=trace6$visible, textfont=trace6$textfont) p <- add_trace(p, x=trace7$x, y=trace7$y, uid=trace7$uid, line=trace7$line, name=trace7$name, type=trace7$type, xsrc=trace7$xsrc, ysrc=trace7$ysrc, marker=trace7$marker, error_x=trace7$error_x, error_y=trace7$error_y, visible=trace7$visible, textfont=trace7$textfont) p <- add_trace(p, x=trace8$x, y=trace8$y, uid=trace8$uid, line=trace8$line, name=trace8$name, type=trace8$type, xsrc=trace8$xsrc, ysrc=trace8$ysrc, marker=trace8$marker, error_x=trace8$error_x, error_y=trace8$error_y, visible=trace8$visible, textfont=trace8$textfont) p <- add_trace(p, x=trace9$x, y=trace9$y, uid=trace9$uid, line=trace9$line, name=trace9$name, type=trace9$type, xsrc=trace9$xsrc, ysrc=trace9$ysrc, marker=trace9$marker, error_x=trace9$error_x, error_y=trace9$error_y, visible=trace9$visible, textfont=trace9$textfont) p <- add_trace(p, x=trace10$x, y=trace10$y, uid=trace10$uid, line=trace10$line, name=trace10$name, type=trace10$type, xsrc=trace10$xsrc, ysrc=trace10$ysrc, marker=trace10$marker, error_x=trace10$error_x, error_y=trace10$error_y, visible=trace10$visible, textfont=trace10$textfont) p <- add_trace(p, x=trace11$x, y=trace11$y, uid=trace11$uid, line=trace11$line, name=trace11$name, type=trace11$type, xsrc=trace11$xsrc, ysrc=trace11$ysrc, marker=trace11$marker, error_x=trace11$error_x, error_y=trace11$error_y, visible=trace11$visible, textfont=trace11$textfont) p <- add_trace(p, x=trace12$x, y=trace12$y, uid=trace12$uid, line=trace12$line, name=trace12$name, type=trace12$type, xsrc=trace12$xsrc, ysrc=trace12$ysrc, marker=trace12$marker, error_x=trace12$error_x, error_y=trace12$error_y, visible=trace12$visible, textfont=trace12$textfont) p <- add_trace(p, x=trace13$x, y=trace13$y, uid=trace13$uid, line=trace13$line, name=trace13$name, type=trace13$type, xsrc=trace13$xsrc, ysrc=trace13$ysrc, marker=trace13$marker, error_x=trace13$error_x, error_y=trace13$error_y, visible=trace13$visible, textfont=trace13$textfont) p <- add_trace(p, x=trace14$x, y=trace14$y, uid=trace14$uid, line=trace14$line, name=trace14$name, type=trace14$type, xsrc=trace14$xsrc, ysrc=trace14$ysrc, marker=trace14$marker, error_x=trace14$error_x, error_y=trace14$error_y, visible=trace14$visible, textfont=trace14$textfont) p <- add_trace(p, x=trace15$x, y=trace15$y, uid=trace15$uid, line=trace15$line, name=trace15$name, type=trace15$type, xsrc=trace15$xsrc, ysrc=trace15$ysrc, marker=trace15$marker, error_x=trace15$error_x, error_y=trace15$error_y, visible=trace15$visible, textfont=trace15$textfont) p <- add_trace(p, x=trace16$x, y=trace16$y, uid=trace16$uid, line=trace16$line, name=trace16$name, type=trace16$type, xsrc=trace16$xsrc, ysrc=trace16$ysrc, marker=trace16$marker, error_x=trace16$error_x, error_y=trace16$error_y, visible=trace16$visible, textfont=trace16$textfont) p <- add_trace(p, x=trace17$x, y=trace17$y, uid=trace17$uid, line=trace17$line, name=trace17$name, type=trace17$type, xsrc=trace17$xsrc, ysrc=trace17$ysrc, marker=trace17$marker, error_x=trace17$error_x, error_y=trace17$error_y, visible=trace17$visible, textfont=trace17$textfont) p <- add_trace(p, x=trace18$x, y=trace18$y, uid=trace18$uid, line=trace18$line, name=trace18$name, type=trace18$type, xsrc=trace18$xsrc, ysrc=trace18$ysrc, marker=trace18$marker, error_x=trace18$error_x, error_y=trace18$error_y, visible=trace18$visible, textfont=trace18$textfont) p <- add_trace(p, x=trace19$x, y=trace19$y, uid=trace19$uid, line=trace19$line, name=trace19$name, type=trace19$type, xsrc=trace19$xsrc, ysrc=trace19$ysrc, marker=trace19$marker, error_x=trace19$error_x, error_y=trace19$error_y, visible=trace19$visible, textfont=trace19$textfont) p <- add_trace(p, x=trace20$x, y=trace20$y, uid=trace20$uid, line=trace20$line, name=trace20$name, type=trace20$type, xsrc=trace20$xsrc, ysrc=trace20$ysrc, marker=trace20$marker, error_x=trace20$error_x, error_y=trace20$error_y, visible=trace20$visible, textfont=trace20$textfont) p <- add_trace(p, x=trace21$x, y=trace21$y, uid=trace21$uid, line=trace21$line, name=trace21$name, type=trace21$type, xsrc=trace21$xsrc, ysrc=trace21$ysrc, marker=trace21$marker, error_x=trace21$error_x, error_y=trace21$error_y, visible=trace21$visible, textfont=trace21$textfont) p <- layout(p, font=layout$font, smith=layout$smith, title=layout$title, width=layout$width, xaxis=layout$xaxis, yaxis=layout$yaxis, bargap=layout$bargap, boxgap=layout$boxgap, height=layout$height, legend=layout$legend, margin=layout$margin, barmode=layout$barmode, boxmode=layout$boxmode, autosize=layout$autosize, dragmode=layout$dragmode, hovermode=layout$hovermode, titlefont=layout$titlefont, separators=layout$separators, showlegend=layout$showlegend, annotations=layout$annotations, bargroupgap=layout$bargroupgap, boxgroupgap=layout$boxgroupgap, hidesources=layout$hidesources, plot_bgcolor=layout$plot_bgcolor, paper_bgcolor=layout$paper_bgcolor)