I'd like to insert a bold title with a hyphen. I've tried:
import matplotlib.pyplot as plt
import numpy as np
# Data for plotting
t = np.arange(0.0, 2.0, 0.01)
s = 1 np.sin(2 * np.pi * t)
fig, ax = plt.subplots()
ax.plot(t, s)
ax.set_title(r"$\bf{hyphenated-example}$")
This displays with a minus sign (hyphenated − example). I don't think I can use any of the solutions from this document explaining how to do it in a pure latex environment; mbox is not recognised.
CodePudding user response:
You can set a bold font by using weight = "bold"
in your title. Using ax.set_title("hyphenated-example", weight = "bold")
gives bold text and a bold hyphen (hyphenated-example).
Different font weights and font styles are found here.