Today I'm working on a graph, and a section of it has annotations using plt.text
. In this annotation I want to write something along the lines of
"The price for this month is: USD$3"
Which, without bolding, translates into code like this:
plt.text(0.5,0.9, f"The price for this month is: USD${df.price.iloc[-1]}")
So, what I want to do is to turn the USD${df.price.iloc[-1]}
into bold when printing into the graph.
There's a similar question in SO, but for the title, that suggested a notation like this one:
"The price for this month is:' + r"$\bf{" + USD${df.price.iloc[-1]} + "}$"
But it seems that that syntax is invalid, so I'm not sure if it's even possible to have a text that has bold and non-bold parts.
Do you know if it can be done and if so, how it can be done?