- 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 exponentially scale the Y axis with matplotlib?
To exponentially scale the Y-axis with matplotlib, we can take the following steps −
- Set the figure size and adjust the padding between and around the subplots.
- Inintialize a variable dt for steps.
- Create x and y data points using numpy.
- Plot the x and y data points using numpy.
- Set the exponential scale for the Y-axis, using plt.yscale('symlog').
- To display the figure, use show() method.
Example
import numpy as np import matplotlib.pyplot as plt plt.rcParams["figure.figsize"] = [7.00, 3.50] plt.rcParams["figure.autolayout"] = True dt = 0.01 x = np.arange(-50.0, 50.0, dt) y = np.arange(0, 100.0, dt) plt.plot(x, y) plt.yscale('symlog') plt.show()
Output
It will produce the following output
- Related Articles
- How to create a barplot with gaps on Y-axis scale in R?
- A scale transform the element by using y-axis with CSS3
- How to plot Exponentially Decaying Function using FuncAnimation in Matplotlib
- How to change the range of the X-axis and Y-axis in Matplotlib?
- How to plot an image with non-linear Y-axis with Matplotlib using imshow?
- How to force the Y axis to use only integers in Matplotlib?
- How to specify values on Y-axis in Python Matplotlib?
- How to share secondary Y-axis between subplots in Matplotlib?
- How to change the scale of Y-axis if the histogram bars are higher than the axis size in R?
- How to turn on minor ticks only on the y-axis Matplotlib?
- Plot a histogram with Y-axis as percentage in Matplotlib
- How to print the Y-axis label horizontally in a Matplotlib/Pylab chart?
- How do I convert (or scale) axis values and redefine the tick frequency in Matplotlib?
- Setting Y-axis in Matplotlib using Pandas
- How to repress scientific notation in factorplot Y-axis in Seaborn / Matplotlib?

Advertisements