- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to change fonts in matplotlib (python)?
Using plt.text() method, we can increase the font size.
Using plt.plot() method, we can create a line with two lists that are passed in its argument.
Add text to the axes. Add the text *s* to the axes at location *x*, *y* in data coordinates, using plt.text() method. Font size can be customized by changing the font-size value.
To show the figure, use plt.show() method.
import matplotlib.pyplot as plt plt.plot([1, 2, 4], [1, 2, 4]) plt.text(2, 3, "y=x", color='red', fontsize=20) # Increase fontsize by increasing value. plt.show()
- How to embed fonts in PDFs produced by Matplotlib
- How to change backends in Matplotlib?
- How to get a list of all the fonts currently available for Matplotlib?
- How to get the list of font family (or Name of Fonts) in Matplotlib?
- How to change axes background color in Matplotlib?
- How to change the legend fontname in Matplotlib?
- Web Fonts in CSS
- How to change the curve using radiobuttons in Matplotlib?
- How to change the spacing between ticks in Matplotlib?
- How to change the strength of antialiasing in Matplotlib?
- How to change Bar Chart values to percentages in Matplotlib?
- How to add custom fonts to a text in JavaFX?
- How to change the figuresize using Seaborn factorplot in Matplotlib?
- How to change the linewidth of a hatch in Matplotlib?
- How to change the marker size with pandas.plot() in Matplotlib?