Since it was me who closed the question, let me share my thoughts.
First of all, my concerns were mostly pointed out by @Andrew T., i.e. choosing font parameters seems to be more related to graphic design. The appearance of the question on CrossValidated.com seems to be a case of boat programming (although I didn't know this term before). Asking about relative font size does not really differ from asking about choosing font family, or colours, for the graph, how to align it on a page, etc., so this is in a graphic design domain. In many cases if figures are submitted with a publication, a graphic designer is the person who makes appropriate adjustments so that they look nice.
Moreover, it is a broad question, where the answer would to great extent depend on personal taste ("does this look better, or that"), but also on many different factors. A figure, or any other element of a publication, or graphic design, would look different on screen, than when posted on a blog, or in a journal article, different if it were printed in a book, or in a PowerPoint presentation, different depending on whether they are printed in colour, greyscale, black and white, or depending on what would be their size (e.g. a small plot in paper vs poster at a conference), using different fonts may need adjustments in their size, etc. Because of all those factors, there will be no single answer to such question.
The question has the following acceptance criteria for the answer
The answer does not have to be in Python or use the above code, that
is just to illustrate the point. If there's a way that the fontsizes
could me made a function of something such as the title, and
literature to support the sizing of them, that would be appreciated.
Notice that this is already handled by the defaults of the plotting software you are using. Whatever you are using, matplotlib, base R graphics, ggplot2, Excel, etc. they all have some predefined defaults that are based on what their authors considered as best practice, or what was most consistent with their aesthetic taste. The fact alone that the OP considers changing those defaults shows that there is no "one size fits all" solutions for this problem. Even more, ggplot2 alone has nine built-in themes with different visual styles, since different users may prefer different appearances of the figures.
Making readable plots should be a concern of any statistician or data scientist, since to communicate our findings we often need to present them. The reason why I closed the question was that it simply does not seem to fall into the pretty narrow scope of this site. The boundary in such cases is often hard to draw, so if the community disagrees, I won't insist on this decision.