Lgd = plt.legend(loc='lower right', prop=font_prop) # NB different 'prop' argument for legend Plt.text(0, 0, "Misc text", fontproperties=font_prop) Plt.ylabel("Amplitude", fontproperties=font_prop) Plt.xlabel("Time", fontproperties=font_prop) Size=16, verticalalignment='bottom') # Size here overrides font_prop Plt.title("Exponentially decaying oscillations", fontproperties=font_prop, t_fontsize(13) # Size here overrides font_prop Plt.plot(x, y, 'b+', label='Data points')įor label in (ax.get_xticklabels() + ax.get_yticklabels()):
![how do i set default font in smart notebook 11 how do i set default font in smart notebook 11](http://wanderingmist.com/wp-content/uploads/handmade-iPad-flip-cover-tutorial-with-kalamkari-cloth.jpg)
# Set the font properties (can use more variables for more fonts)įont_path = 'C:\Windows\Fonts\AGaramondPro-Regular.otf'įont_prop = font_manager.FontProperties(fname=font_path, size=14)Īx = plt.subplot() # Defines ax variable by creating an empty plot # Set the font dictionaries (for plot title and axis titles) Import matplotlib.font_manager as font_manager It basically combines ryggyr's answer here with other answers on SO. It is rather cumbersome but I could not get to grips with any other method personally. It does not use rc (which doesn't seem to work for me).
![how do i set default font in smart notebook 11 how do i set default font in smart notebook 11](https://samsungtechwin.com/wp-content/uploads/2022/01/samsung-s9-text-scaling-chrome-1img_61d3b865c6a28-2022-01-4.jpg)
This answer is for anyone trying to change all the fonts, including for the legend, and for anyone trying to use different fonts and sizes for each thing. Should be fixed in 2.0.1 but I've included the workaround in the 2nd part of the answer.
HOW DO I SET DEFAULT FONT IN SMART NOTEBOOK 11 UPDATE
Update #3: There is a bug in Matplotlib 2.0.0 that's causing tick labels for logarithmic axes to revert to the default font. Update #2: I've figured out changing legend title fonts too. Update: See the bottom of the answer for a slightly better way of doing it.