SuperSubScriptHelper——Unicode上下标辅助类 在项目的实施过程中,类似化学分子式、平方、立方等,需要处理上、下标字符。上下标字符的实现,大致有两种方式,一种是字符本身包含上下标信息,另一种方式是通过格式化标记实现上下标字符的显示。...此种方式灵活,可以将任意字符作为上下标,简单的可以理解为在四线格上写字,...
Here is another example that writes text in subscript in the axis labels and the legend.Open Compiler import numpy as np import matplotlib.pyplot as plt # Adjust figure size and autolayout plt.rcParams["figure.figsize"] = [7.00, 3.50] plt.rcParams["figure.autolayout"] = True # Generate ...
Roots and Exponents: Square root: `\sqrt{x}`, Exponent: `x^2`, Subscript: `x_1`, Superscript: `x^i` Other Notations Fractions: `\frac{numerator}{denominator}` Matrices: `bmatrix`, `pmatrix`, `vmatrix`, etc., using the `amsmath` package Special Symbols: For example, `\infty` fo...
plot(x, y, 'o-', label='Data') # Annotating a point with a subscript and a superscript plt.annotate(r'$\mathrm{Point}_{\mathrm{max}}^{(4, 10)}$', xy=(x[y.index(max(y))], max(y)), xytext=(3, 8), arrowprops=dict(facecolor='black', arrowstyle='->'), fontsize=12,...