Different font sizes in the same annotation of matplotlib

Make your plot first, then use ax.annotate, iterating over your x coordinates, y coordinates, labels and fontsizes. import matplotlib.pyplot as plt X = [1,2,3,4,5] Y = [1,1,1,1,1] labels=”ABCDE” sizes = [10, 15, 20, 25, 30] fig, ax = plt.subplots() ax.scatter(X, Y) for x, y, label, size in zip(X, Y, labels, sizes): ax.annotate(label, (x, y), fontsize=size) …

Read more

How to use css to change font size

While the font-size cannot be changed for text directly inside pre tags, you can always wrap that text in another element (a span, for example) and change the font size of that element. For example (this is inline-styles, but could be put in CSS if you wanted): <pre><span class=”inner-pre” style=”font-size: 11px”> Blah blah Multiple lines …

Read more

Why is a table not using the body font size even though I haven’t set the table font size explicitly?

Ever wonder why an <h1> looks BIG even when you don’t use any CSS rules? This is because web browsers have default CSS rules built in. Included in this default CSS are rules for tables. Unfortunately, these hidden CSS rules sometimes play nasty tricks on us web developers, and this is why people use Reset …

Read more