Library ( plotly ) month % add_trace ( y = ~ low_2014, type = 'scatter', mode = 'lines', fill = 'tonexty', fillcolor = 'rgba(0,100,80,0. Library ( plotly ) x % add_trace ( y = ~ y_television, type = 'scatter', mode = 'lines', line = list ( color = 'rgba(67,67,67,1)', width = 2 )) fig % add_trace ( y = ~ y_internet, type = 'scatter', mode = 'lines', line = list ( color = 'rgba(49,130,189, 1)', width = 4 )) fig % add_trace ( x = ~ c ( x, x ), y = ~ c ( y_television, y_television ), type = 'scatter', mode = 'markers', marker = list ( color = 'rgba(67,67,67,1)', size = 8 )) fig % add_trace ( x = ~ c ( x, x ), y = ~ c ( y_internet, y_internet ), type = 'scatter', mode = 'markers', marker = list ( color = 'rgba(49,130,189, 1)', size = 12 )) fig % layout ( title = "Main Source for News", xaxis = xaxis, yaxis = yaxis, margin = margin, autosize = FALSE, showlegend = FALSE, annotations = television_1 ) fig % layout ( annotations = internet_1 ) fig % layout ( annotations = television_2 ) fig % layout ( annotations = internet_2 ) fig Parameter 2 specifies points on the y-axis. Parameter 1 specifies points on the x-axis. The function takes parameters for specifying points in the diagram. Library ( plotly ) month % add_trace ( y = ~ low_2014, name = 'Low 2014', line = list ( color = 'rgb(22, 96, 167)', width = 4 )) fig % add_trace ( y = ~ high_2007, name = 'High 2007', line = list ( color = 'rgb(205, 12, 24)', width = 4, dash = 'dash' )) fig % add_trace ( y = ~ low_2007, name = 'Low 2007', line = list ( color = 'rgb(22, 96, 167)', width = 4, dash = 'dash' )) fig % add_trace ( y = ~ high_2000, name = 'High 2000', line = list ( color = 'rgb(205, 12, 24)', width = 4, dash = 'dot' )) fig % add_trace ( y = ~ low_2000, name = 'Low 2000', line = list ( color = 'rgb(22, 96, 167)', width = 4, dash = 'dot' )) fig % layout ( title = "Average High and Low Temperatures in New York", xaxis = list ( title = "Months" ), yaxis = list ( title = "Temperature (degrees F)" )) fig The plot () function is used to draw points (markers) in a diagram.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |