How do I write text in subscript in the axis labels and the legend? December 2, 2023 by Tarik Put dollar signs around the formula: plt.xlabel("$n_1$")