[Python] Use matplotlib.pyplot.rcparams with a custom font which is not installed

Discussão em 'Python' iniciado por Stack, Novembro 25, 2025.

  1. Stack

    Stack Membro Participativo

    I'm trying to use a custom ttf font not installed in the system for text element in the matplotlib figure.

    with plt.style.context('mplparams.mplstyle'):
    plt.plot(np.sin(np.linspace(0, 3 * np.pi)), '-o')


    I know I can change the text properties with FontManager but I'm looking for a solution which only involves an external config file.

    At the moment I only know that i can change font.sans-serif to a font name, not font path.

    Is this possible?

    Continue reading...

Compartilhe esta Página