File:Exponential cdf.svg

Uploaded by AkanoToE
Upload date 2020-11-21T18:11:21Z
MIME type image/svg+xml
Dimensions 360 × 288 px
File size 31.8 KB

Summary

Description
English: Plot of the cumulative distribution functions of several exponential distributions.
Date
Source Own work
Author Skbkekas
SVG development
InfoField
 The SVG code is valid.
 This plot was created with Matplotlib.
Source code
InfoField

Python code

import numpy as np
import matplotlib.pyplot as plt

col = {0.5: 'orange', 1: 'purple', 1.5: 'lightblue'}

X = np.arange(0, 5, 0.01)

##                                                                              
## PDF                                                                          
##                                                                              

plt.clf()
plt.figure(figsize=(4,3.2))
plt.axes([0.15,0.13,0.79,0.8])
plt.hold(True)

A = []
for L in 0.5,1,1.5:
    P = L*np.exp(-L*X)
    a = plt.plot(X, P, '-', color=col[L], lw=2.5)
    A.append(a)

plt.xlabel("x")
plt.ylabel("P(x)")

bx = plt.legend(A, (r"$\lambda=0.5$", r"$\lambda=1$", r"$\lambda=1.5$"),\
                numpoints=1, handletextpad=0.5, loc="upper right")
bx.draw_frame(False)
plt.xlim(0,5)

plt.savefig("exponential_pdf.pdf")
plt.savefig("exponential_pdf.svg")


##                                                                              
## CDF                                                                          
##                                                                              

plt.clf()
plt.figure(figsize=(4,3.2))
plt.axes([0.15,0.13,0.79,0.8])
plt.hold(True)

A = []
for L in 0.5,1,1.5:
    P = 1- np.exp(-L*X)
    a = plt.plot(X, P, '-', color=col[L], lw=2.5)
    A.append(a)

plt.xlabel("x")
plt.ylabel(u"P(X\N{Less-THAN OR EQUAL TO}x)")

bx = plt.legend(A, (r"$\lambda=0.5$", r"$\lambda=1$", r"$\lambda=1.5$"),\
                numpoints=1, handletextpad=0.5, loc="lower right")
bx.draw_frame(False)
plt.xlim(0,5)

plt.savefig("exponential_cdf.pdf")
plt.savefig("exponential_cdf.svg")

Licensing

I, the copyright holder of this work, hereby publish it under the following license:
w:en:Creative Commons
attribution
This file is licensed under the Creative Commons Attribution 3.0 Unported license.
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.

Captions

Add a one-line explanation of what this file represents

Items portrayed in this file

depicts

18 February 2010

32,593 byte

image/svg+xml

e9b3f2902d4ec4c03ac8336fb4f08521f5aff0ec

Category:CC-BY-3.0 Category:Exponential distribution Category:Self-published work Category:Valid SVG created with Matplotlib code