- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
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 remove scientific notation from a Matplotlib log-log plot?
To remove scientific notation from a matplotlib log-log plot, we can use ax.xaxis.set_minor_formatter(mticker.ScalarFormatter()) statement.
Steps
- Set the figure size and adjust the padding between and around the subplots.
- Create x and y data points using numpy.
- Plot x and y data points using scatter() method.
- Set x and y axes sacle using set_xscale() and set_yscale() methods.
- To remove scientific notation, use format tick values as a number.
- To display the figure, use show() method.
Example
import numpy as np from matplotlib import pyplot as plt, ticker as mticker plt.rcParams["figure.figsize"] = [7.50, 3.50] plt.rcParams["figure.autolayout"] = True x = np.array([1, 7, 6, 4, 0]) y = np.array([6, 2, 3, 5, 1]) plt.scatter(y, x, c=x, cmap="copper") ax = plt.gca() ax.set_xscale('log') ax.set_yscale('log') ax.xaxis.set_minor_formatter(mticker.ScalarFormatter()) plt.show()
Output
- Related Articles
- How to remove scientific notation form base R plot?
- How to plot contourf and log color scale in Matplotlib?
- How to disable the minor ticks of a log-plot in Matplotlib?
- How do I show logarithmically spaced grid lines at all ticks on a log-log plot using Matplotlib?
- Show decimal places and scientific notation on the axis of a Matplotlib plot
- How to draw a log-normalized imshow plot with a colorbar representing the raw data in Matplotlib?
- Plot yscale class linear, log, logit and symlog by name in Matplotlib?
- How to show minor tick labels on a log-scale with Matplotlib?
- Matplotlib log scale tick label number formatting
- How to change the font size of scientific notation in Matplotlib?
- Evaluate: $log\ sin1^o.log\ sin 2^o. log\ sin3^o\ ........log\ sin90^o$.
- How to create bar plot with log values using ggplot2 in R?
- How to repress scientific notation in factorplot Y-axis in Seaborn / Matplotlib?
- How to enable MySQL Query Log?
- How to make a log histogram in Python?

Advertisements