Мне нужно изменить размер метки и заголовка графического графика.
Я нашел способ изменить только метку оси и размер заголовка оси.
Более того Я не понимаю, почему отображается заголовок оси x, а заголовок оси y нет, когда я указал оба.
Вот мой код:
cc <- count(mydata, year_dx1, Age)
cc2 <- left_join(cc, count(cc, year_dx1, wt = n, name = 'nn'))
cc2 %>%
mutate(Percentage = (n / nn)*100) %>%
plot_ly(x = ~year_dx1, y = ~Percentage, color = ~Age) %>%
add_bars() %>%
layout(barmode = "stack")%>%
layout(title = 'Age at diagnosis distribution by time', xaxis
= list(title = 'Year of diagnosis',
yaxis = list(title = 'Count')))%>%
layout(
xaxis = list(titlefont = list(size = 22), tickfont =
list(size = 22)),
yaxis = list(titlefont = list(size = 22), tickfont =
list(size = 22)))
Я пробовал в этом Кстати, но это не работает:
cc <- count(mydata, year_dx1, Age)
cc2 <- left_join(cc, count(cc, year_dx1, wt = n, name ='nn'))
cc2 %>% mutate(Percentage = (n / nn)*100) %>%
plot_ly(x = ~year_dx1, y = ~Percentage, color = ~Age) %>%
add_bars() %>% layout(barmode = "stack")%>% layout(title ='Age at diagnosis distribution by time', xaxis = list(title = 'Year of diagnosis',yaxis = list(title = 'Count')))%>%
layout(xaxis = list(titlefont = list(size = 22), tickfont =
list(size = 22)),yaxis = list(titlefont = list(size = 22), tickfont =list(size = 22)),legend = list(tickfont = list(size = 22)))
Вот мой график:
Вот мои данные:
> mydata$Age
[2] ">64,<=72" ">64,<=72" "<=53" "<=53" "<=53" ">53,<=64" "<=53"
[8] ">72" ">53,<=64" ">64,<=72" ">64,<=72" ">53,<=64" ">72" ">64,<=72"
[15] ">53,<=64" ">72" "<=53" "<=53" "<=53" ">53,<=64" ">72"
[22] ">72" ">53,<=64" ">53,<=64" ">64,<=72" ">72" "<=53" ">72"
[29] ">72" ">53,<=64" ">53,<=64" ">72" ">53,<=64" "<=53" ">53,<=64"
[36] ">64,<=72" ">72" ">64,<=72" ">64,<=72" ">72" ">64,<=72" ">64,<=72"
[43] ">53,<=64" ">72" ">53,<=64" ">72" ">64,<=72" ">64,<=72" ">72"
[50] "<=53" ">53,<=64" ">53,<=64" ">72" ">64,<=72" ">72" ">72"
[57] ">72" ">72" ">72" ">64,<=72" "<=53" ">53,<=64" ">53,<=64"
[64] ">64,<=72" ">72" ">72" ">53,<=64" ">72" ">72" ">72"
[71] "<=53" "<=53" "<=53" ">64,<=72" "<=53" ">53,<=64" ">53,<=64"
[78] ">64,<=72" ">72" ">53,<=64" "<=53" "<=53" "<=53" ">72"
[85] ">72" ">64,<=72" "<=53" ">53,<=64" ">64,<=72" ">53,<=64" "<=53"
[92] "<=53" ">72" ">72" ">53,<=64" ">53,<=64" "<=53" ">72"
[99] ">53,<=64" ">64,<=72" ">72" ">53,<=64" ">72" ">64,<=72" ">64,<=72"
> mydata$year_dx1
[2] "2015-2019" "2010-2014" "2005-2009" "2010-2014" "2005-2009" "2010-2014"
[7] "2000-2004" "2010-2014" "2000-2004" "2005-2009" "1995-1999" "2010-2014"
[13] "2005-2009" "2005-2009" "2005-2009" "2015-2019" "2015-2019" "2015-2019"
[19] "2015-2019" "2010-2014" "2010-2014" "2010-2014" "2015-2019" "2010-2014"
[25] "2010-2014" "2005-2009" "2015-2019" "2005-2009" "2015-2019" "2005-2009"
[31] "2010-2014" "2015-2019" "2005-2009" "2010-2014" "2005-2009" "2010-2014"
[37] "2015-2019" "2005-2009" "2010-2014" "2005-2009" "2005-2009" "2010-2014"
[43] "2015-2019" "2010-2014" "2010-2014" "2015-2019" "2005-2009" "2015-2019"
[49] "2010-2014" "2015-2019" "2010-2014" "2015-2019" "2015-2019" "2015-2019"
[55] "2015-2019" "2015-2019" "2015-2019" "2015-2019" "2010-2014" "2015-2019"
[61] "1995-1999" "2015-2019" "2010-2014" "2015-2019" "2005-2009" "2005-2009"
[67] "2015-2019" "2010-2014" "2015-2019" "2015-2019" "2015-2019" "2015-2019"
[73] "1995-1999" "2005-2009" "2015-2019" "2010-2014" "2000-2004" "2005-2009"
[79] "2010-2014" "2005-2009" "2010-2014" "1995-1999" "2010-2014" "2015-2019"
[85] "2015-2019" "2015-2019" "2010-2014" "2005-2009" "2015-2019" "2010-2014"
[91] "2005-2009" "2010-2014" "2000-2004" "2015-2019" "2005-2009" "2000-2004"
[97] "1995-1999" "2015-2019" "2015-2019" "2000-2004" "2010-2014" "2010-2014"
[103] "2010-2014" "2010-2014" "2010-2014" "2000-2004" "2010-2014" "2015-2019"
Как я могу решить эту проблему?