For another example of using the discrete attribute map, see my article on how to specify the colors of groups.…