I want to print the foll. as x-axis label in matplotlib:
r'$Area (km^{2})$'
However, when I pass it along to plt.ylabel(r'$Area (km^{2})$')
, the resulting plot does not have a space between Area
and (km^{2})
. How do I introduce a space between them?
You need to add \
before space character:
`r'$Area\ (km^{2})$'`
Or move Area
(with space) out of $...$
expression:
r'Area $(km^{2})$'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With