# set margins for map
m <- list(l = 50, r = 50, b = 100, t = 100, pad = 4)
# make plot
fig <- plot_ly(matmort, type = 'choropleth', locations = ~Code, z = ~Xlog, zmax = 5, hoverinfo = "text", text = ~paste("<br> Country: ", Entity, "<br> Deaths: ", X), colorscale = "Reds")
fig <- fig %>%
colorbar(title = "Deaths per 100 000 live births", len = 0.75, thickness = 20, y = 0.9, tickmode = "array", tickvals = list(0, 0.7, 1, 1.7, 2, 2.7, 3, 3.7, 4, 4.7, 5), ticktext = list(0, 5, 10, 50, 100, 500, 1000, 5000, 10000, 50000, 100000)) %>%
layout(autosize = F, width = 800, height = 500, margin = m)