Black Lives Matter. Please consider donating to Black Girls Code today.

Multiple x-axis didn't show variable name

hello plotly community

I’m try to plot two x-axis with shiny.
The problem is i can’t get variable name(Cities and Month) to show under the chart.
the plot i can do

mydatasheet


Month Cities Robberies Accident born dead
1966-01 New york 41 15 10 3
1966-02 New york 39 26 8 3
1966-03 New york 50 12 5 3
1966-04 New york 40 32 10 3
1966-05 New york 43 11 15 1
1966-06 New york 38 5 8 3
1966-07 New york 44 30 11 2
1966-08 New york 35 19 13 2
1966-09 New york 39 33 7 2
1966-10 New york 35 25 11 2
1966-11 New york 29 24 13 3
1966-12 New york 49 29 8 2
1966-01 Philadephia 50 11 10 2
1966-02 Philadephia 59 14 12 2
1966-03 Philadephia 63 36 15 1
1966-04 Philadephia 32 25 9 2
1966-05 Philadephia 39 12 15 1
1966-06 Philadephia 47 20 6 3
1966-07 Philadephia 53 22 8 1
1966-08 Philadephia 60 31 10 2
1966-09 Philadephia 57 18 8 2
1966-10 Philadephia 52 23 11 4
1966-11 Philadephia 70 30 15 2
1966-12 Philadephia 90 27 6 3
1966-01 California 74 28 10 2
1966-02 California 62 22 8 2
1966-03 California 55 26 5 1
1966-04 California 84 16 10 1
1966-05 California 94 25 15 2
1966-06 California 70 29 8 2
1966-07 California 108 17 11 1
1966-08 California 139 20 13 2
1966-09 California 120 21 8 1
1966-10 California 97 19 15 2
1966-11 California 126 24 6 0
1966-12 California 149 29 8 2

mycode

library(shiny)
library(plotly)

data <- data.frame(Month,Cities,Accident,Robberies,Born,Dead)

ui <- fluidPage(
    titlePanel("BABABA BABANANA"),
    sidebarLayout(   
        sidebarPanel(
            selectInput("var_y1", 
                        label = "Choose a Y1-axis ",
                        choices = c("ACC","ROB","born","dead"), 
                        selected = "ACC"),  
            br(),
            actionButton("close", "Click to disconnect")
        ),
        mainPanel(      
            textOutput("min_max")            
        )
    ),
    hr(),       
    fluidRow(
        column(4, verbatimTextOutput("value")),
        column(4, verbatimTextOutput("range"))
    )
)

server <- function(input, output) {

    observeEvent(input$close, {
        stopApp()
    })

    output$selected_var <- renderPlotly({ 
      xaxis <- list(title = 'Cities & Month','tickvals'= seq(1, length(data$Cities)),
              'ticktext' = paste(data$Month,data$Cities, sep='<br />'),
              'tickmode' = 'array',autotick = F)              
       yaxis <- list(title = 'number of person' )       
      r <- plot_ly(data, x=seq(1, length(data$Cities)),y = ~Accident,name = 'Accident/Month', type = 'scatter', mode = 'lines+markers', line = list(shape = "spline"))%>%
        layout(title = 'Accident of 3Cities',xaxis = xaxis,yaxis = yaxis)                           
      s <- plot_ly(data,x=seq(1, length(data$Cities)),y = ~Robberies,name = 'Robberies/Month', type = 'scatter', mode = 'lines+markers', line = list(shape = "spline")) %>%
         layout(title = 'Robberies of 3Cities',xaxis  = xaxis,yaxis = yaxis) 
           if(input$var_y1 == "ACC"){
            r
           }
           else if(input$var_y1 == "ROB"){
            s
           }   
        })     
}  
# Run the app ----cc
shinyApp(ui = ui, server = server)

I want to show variable name to under the chart. (Cities name and Month)

Best regard