0

I know how to insert a subscript in a matplotlib plot using the following expression:

r'$P1_{ti-1}$'

However I would like to do a subscript of a subscript, something like:

r'$P1_{t}_{i-1}$'

where t is a subscript of P1 and i-1 is a subscript of t bt I cannot find any working example.

Thank you.

1 Answer 1

1

It is possible depending on how you nest your curly braces.

See the example below:

import matplotlib.pyplot as plt 
plt.plot([1,2,3,],[1,2,3])
plt.text(s=r'$P1_{t_{i-1}}$',x=2, y=1.5, size=20)
plt.show()

subscript on chart

See this overleaf doc page for more info.

Sign up to request clarification or add additional context in comments.

1 Comment

No worries. Please consider accepting the answer if it was useful.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.