- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- 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 the font size of scientific notation in Matplotlib?
To change the fontsize of scientific notation in matplotlib, we can take the following steps −
Set the figure size and adjust the padding between and around the subplots.
Make a list of x and y values.
Plot x and y data points using plot() method.
To change the font size of scientific notation, we can use style="sci" class by name.
To display the figure, use show() method.
Example
from matplotlib import pyplot as plt plt.rcParams["figure.figsize"] = [7.50, 3.50] plt.rcParams["figure.autolayout"] = True x = [10000, 20000, 300000, 34, 1, 10000] y = [1, 2, 0, 4, 1, 5] plt.plot(x, y, color='red') plt.ticklabel_format(axis="x", style="sci", scilimits=(0, 0)) plt.show()
Output
- Related Articles
- How to change xticks font size in a matplotlib plot?
- How do I change the font size of the scale in Matplotlib plots?
- How can I change the font size of ticks of axes object in Matplotlib?
- How to repress scientific notation in factorplot Y-axis in Seaborn / Matplotlib?
- How to remove scientific notation from a Matplotlib log-log plot?
- How to change font size in HTML?
- How to change font size in ttk.Button?
- How to change the font size of textView in android?
- How to modify the font size in Matplotlib-venn?
- How to increase plt.title font size in Matplotlib?
- How to set the font size of Matplotlib axis Legend?
- How to change the font size of Text using FabricJS?
- How to deactivate scientific notation of numbers in R?
- How to change the font size of legend in base R plot?
- How to change the font size of a text using JavaScript?

Advertisements