Issue
How do I add a column vector as text to my plot using matplotlib?
For example:
Is there a way of writing this using plt.text()? The closest I've got is writing it out as a fraction, although not encapsulated by brackets:
plt.text(0,0, r'$\frac{x}{y}$')
However, as it's a vector, I effectively need a line-less fraction contained within brackets.
Solution
If you only need a 2-vector, you can use the \binom{}{}
LaTeX command.
import matplotlib.pyplot as plt
plt.text(0, 0, r"$\binom{x}{y}$", fontsize=100, ha="center", va="center")
plt.xlim(-1,1)
plt.ylim(-1,1)
Answered By - jared
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.