I was wondering if there's a way to have a custom icon for plotly's pie chart instead of the usual pie division
As of now I'm displaying the gender information using a pie chart which looks as below:
I'm trying to make it look like the gender plot in the link below:
The plotly code is as under:
plot_ly(genderselection, labels = ~Gender, values = ~Freq, type = 'pie') %>%
layout(title = paste0("Gender Distribution of Patients from Boston"),
xaxis = list(showgrid = FALSE, zeroline = FALSE, showticklabels = FALSE),
yaxis = list(showgrid = FALSE, zeroline = FALSE, showticklabels = FALSE),
legend=list(orientation='h'))
The genderselection dataframe:
Gender Freq
F 70
M 65
If not using plotly is there any other library that can be used to display information using custom icons ?
(1) Download the png file available here and save it in your working directory as
man_woman.png
(2) Run the following code: