diff --git a/examples/text_labels_and_annotations/unicode_minus.py b/examples/text_labels_and_annotations/unicode_minus.py index 892df43bab68..860c930a8f83 100644 --- a/examples/text_labels_and_annotations/unicode_minus.py +++ b/examples/text_labels_and_annotations/unicode_minus.py @@ -9,12 +9,20 @@ __ https://en.wikipedia.org/wiki/Plus_and_minus_signs#Character_codes -This example showcases the difference between the two glyphs. +The replacement is performed at draw time of the tick labels (usually during a +`.pyplot.show()` or `.pyplot.savefig()` call). Therefore, all tick labels of +the figure follow the same setting and we cannot demonstrate both glyphs on +real tick labels of the same figure simultaneously. + +Instead, this example simply showcases the difference between the two glyphs +in a magnified font. """ import matplotlib.pyplot as plt -fig = plt.figure() -fig.text(.5, .5, "Unicode minus: \N{MINUS SIGN}1", horizontalalignment="right") -fig.text(.5, .4, "ASCII hyphen: -1", horizontalalignment="right") +fig = plt.figure(figsize=(4, 2)) +fig.text(.15, .6, "Unicode minus:", fontsize=20) +fig.text(.85, .6, "\N{MINUS SIGN}1", ha='right', fontsize=20) +fig.text(.15, .3, "ASCII hyphen:", fontsize=20) +fig.text(.85, .3, "-1", ha='right', fontsize=20) plt.show()