- 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 show the Logarithmic plot of a cumulative distribution function in Matplotlib?
To show the Logarithmic plot of a cumulative distribution function in Matplotlib, we can take the following steps.
Steps
- Set the figure size and adjust the padding between and around the subplots.
- Initialize a variable, N, for number of sample data.
- Create data, X2 and F2 using numpy.
- Plot X2 and F2 using plot() method.
- Make x and y scale logarithmic.
- To display the figure, use show() method.
Example
import numpy as np import matplotlib.pyplot as plt plt.rcParams["figure.figsize"] = [7.50, 3.50] plt.rcParams["figure.autolayout"] = True N = 100 data = np.random.randn(N) X2 = np.sort(data) F2 = np.array(range(N))/float(N) plt.plot(X2, F2) plt.xscale('log') plt.yscale('log') plt.show()
Output
- Related Articles
- How to add vertical lines to a distribution plot (sns.distplot) in Matplotlib?
- How to plot a multivariate function in Python Matplotlib?
- How to show tick labels on top of a matplotlib plot?
- How to show a bar and line graph on the same plot in Matplotlib?
- How to plot a function defined with def in Python? (Matplotlib)
- How to create normal quantile-quantile plot for a logarithmic model in R?
- How to plot Exponentially Decaying Function using FuncAnimation in Matplotlib
- How to create a cumulative sum plot in base R?
- How to plot gamma distribution with alpha and beta parameters in Python using Matplotlib?
- Explain the difference between a frequency distribution and a cumulative frequency distribution.
- Define cumulative frequency distribution.
- How do you just show the text label in a plot legend in Matplotlib?
- How to create a plot of Poisson distribution in R?
- How to create a plot of binomial distribution in R?
- How to create a plot of empirical distribution in R?

Advertisements