We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Thanks for sharing!
I have a question about how to change the font for the label; I tried
font_path = fm.findfont(fm.FontProperties(family='Times New Roman')) font_prop = fm.FontProperties(fname=font_path, size=18)
labelLines(axs["D"].get_lines(), align=True, fontsize=18,fontproperties=font_prop)
It seems can't work...
The text was updated successfully, but these errors were encountered:
Actually, you can use font and fontsize directly. For example:
font
fontsize
import numpy as np from matplotlib import pyplot as plt from labellines import labelLines x = np.linspace(0, 10, 300) fig, ax = plt.subplots() ax.plot(x, np.sin(x), label='np.sin') labelLines(ax.get_lines(), zorder=2.5, font="Times New Roman", fontsize=18)
If you want to use fontproperties for some reason, you can try:
fontproperties
import matplotlib.font_manager as fm x = np.linspace(0, 10, 300) font_prop = fm.FontProperties(family="Times New Roman", size=18) fig, ax = plt.subplots() ax.plot(x, np.sin(x), label='np.sin') labelLines(ax.get_lines(), zorder=2.5, fontproperties=font_prop)
But in the end, your example of using the font_path should work. For example:
font_path
font_path = fm.findfont(fm.FontProperties(family='Times New Roman')) font_prop = fm.FontProperties(fname=font_path, size=18) fig, ax = plt.subplots() ax.plot(x, np.sin(x), label='np.sin') labelLines(ax.get_lines(), zorder=2.5, fontproperties=font_prop)
Sorry, something went wrong.
No branches or pull requests
Thanks for sharing!
I have a question about how to change the font for the label; I tried
font_path = fm.findfont(fm.FontProperties(family='Times New Roman'))
font_prop = fm.FontProperties(fname=font_path, size=18)
labelLines(axs["D"].get_lines(), align=True, fontsize=18,fontproperties=font_prop)
It seems can't work...
The text was updated successfully, but these errors were encountered: