I am writing a script to automatically plot some data that includes a mosaic plot. The default order of the response (Y axis) is alphabetical. I would rather have it go from largest percentage to smallest (from the population as a whole) so that the largest blocks are always on the bottom and the smallest on the top (although I'm aware it won't be like that for all the factors, but in my case it will generally be true). Is there a way to do that? I'm thinking one way to trick it would be to create a new column that put a number representing the rank in front of the description, but I'm not even sure of the best way to do that. Thanks.