## 초기화 및 한국 확진자 선 scatter 트레이스 생성R_layout_line <- df_covid19_100_wide |>plot_ly() |>add_trace(type ='scatter', mode ='lines',x =~date, y =~확진자_한국, name ='한국')## 아시아 확진자 선 scatter 트레이스 추가R_layout_line <- R_layout_line |>add_trace(type ='scatter', mode ='lines',x =~date, y =~확진자_아시아, name ='아시아', showlegend =FALSE)## 유럽 확진자 선 scatter 트레이스 추가R_layout_line <- R_layout_line |>add_trace(type ='scatter', mode ='lines',x =~date, y =~확진자_유럽, name ='유럽')## 북미 확진자 선 scatter 트레이스 추가R_layout_line <- R_layout_line |>add_trace(type ='scatter', mode ='lines',x =~date, y =~확진자_북미, name ='북미')## 범례 layout 설정R_layout_line <- R_layout_line |>layout(title =list(text ='<b>대륙별 신규 확진자수 추이</b>',x =0.5, xanchor ='center', yanchor ='top'),legend =list(orientation ='v', bordercolor ='gray', borderwidth =2,x =0.95, y =0.95, xanchor ='right') )R_layout_line
여백 설정
R_layout_line <- R_layout_line |>## 여백 설정layout(margin =list(t =50, b =25, l =25, r =25))R_layout_line
플롯 크기 설정
R_layout_scatter |>## 플롯 사이즈 설정, 작동하지 않음 layout(width =450, height =700) ## Specifying width/height in layout() is now deprecated.Please specify in ggplotly() or plot_ly()
Warning: Specifying width/height in layout() is now deprecated.
Please specify in ggplotly() or plot_ly()